var_dump(function_exists('b')); // false function a(){ $var = 123; function b(){ //这里怎么调用 $var 变量? //不能将该函数改为匿名函数 } } var_dump(function_exists('b')); // false a(); var_dump(function_exists('b')); // true 这里必须为true
Requires that function b must be in function a, and function b must be a global variable
If b is changed to an anonymous function, $var can be called, but if an anonymous function is used, how can it be upgraded to What about global functions?