闭包函数也可以作为变量的值来使用。
<?php $put = function($name) { printf("%s\r\n", $name); }; $put('World'); $put('PHP'); ?>
<?php $aaa = 111; $func = function() use($aaa){ print $aaa; }; $aaa = 222; $func(); // Outputs "111" ?>