是可以嵌套方式调用lambda函数
<?php
$func=function() use($something,$func /** as you know it will be undefined so what could be other way arround**/){
if($something){
$func();
}
}
Run Code Online (Sandbox Code Playgroud)
$func传递给它时尚未定义$func.$func只会在函数定义之后定义,这对于它来说有点太晚了.
简单的解决方法如下:
$func = null;
$func = function() use (&$func) {
}
Run Code Online (Sandbox Code Playgroud)