Edit report at http://bugs.php.net/bug.php?id=50877&edit=1

 ID:               50877
 Comment by:       dchurch at sciencelogic dot com
 Reported by:      giorgio dot liscio at email dot it
 Summary:          Provide javascript equivalent of arguments.callee
                   (closures)
 Status:           Open
 Type:             Feature/Change Request
 Package:          Feature/Change Request
 Operating System: all
 PHP Version:      5.3.1

 New Comment:

This can already be done.  Use the following code:



$countup = function($count) use (&$countup)

{

    echo $count++;

    if ($count<100)

        $countup($count);

};

$countup();


Previous Comments:
------------------------------------------------------------------------
[2010-01-29 06:43:42] giorgio dot liscio at email dot it

Description:
------------
hi, in future i hope to can get the callee of an anonymous function...
for example:

Reproduce code:
---------------
function(&$count) use (0)

{

     echo $count++;

     if($count<100)

     {func_get_callee()}($count);

}



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=50877&edit=1

Reply via email to