PHP 匿名函数 递归实现
<?php
$test = NULL;
$test = function ($a) use (&$test) {
echo $a;
$a --;
if ($a > 0) {
return $test($a);
}
};
$test(10);
http://stackoverflow.com/questions/2480179/anonymous-recursive-php-functions
心安之处 即为家
<?php
$test = NULL;
$test = function ($a) use (&$test) {
echo $a;
$a --;
if ($a > 0) {
return $test($a);
}
};
$test(10);
http://stackoverflow.com/questions/2480179/anonymous-recursive-php-functions