PHP版本:5.4PHP調用匿名函數內部匿名函數
function foo(callable $succCallback) {
$isCallable = is_callable($succCallback);
echo "is callable outer ".is_callable($succCallback);
$success = function($fileInfo) {
echo "<br>is callable inner".is_callable($succCallback);
};
$this->calllll($success);
}
function calllll(callable $foo) {
$foo("hello");
}
我定義這樣的
功能,輸出爲
is callable outer 1
is callable inner
我如何可以參照$succCallback
內$success
的身體。