Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道您可以在声明的方法中找到方法名称,例如:
function getFunction() { return __METHOD__; } echo getFunction(); // 'getFunction'
但是如何找到匿名函数的变量名,例如下面的示例?
$anonymous = function() { return __VARIABLE__ } echo $anonymous; // 'anonymous