1

I know you can find the method name inside a declared method such as:

function getFunction() {
    return __METHOD__;
}
echo getFunction(); // 'getFunction'

But how do you find the variable name of an anonymous function such as the example below?

$anonymous = function() {
    return __VARIABLE__
}
echo $anonymous; // 'anonymous
user1105430
  • 1,379
  • 3
  • 15
  • 27
  • Why do you need to do this? You can get the name of the variable (in a somewhat convoluted manner) as described [here](http://stackoverflow.com/questions/255312/how-to-get-a-variable-name-as-a-string-in-php). – George Cummins Apr 12 '13 at 03:29
  • @GeorgeCummins for curl_multi_init(), which will execute multiple multi-threaded downloads in a loop. I wanted to identify each progress function individually inside the loop. – user1105430 Apr 12 '13 at 03:34

0 Answers0