note 94313 modified in functions.anonymous by danbrown
| From: | danbrown@php.net | Date: | Wed, 28 Oct 2009 16:42:34 +0000 |
| Subject: | note 94313 modified in functions.anonymous by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162199@lists.php.net to get a copy of this message | ||
To recursively call a closure, use this code.
<?php
$recursive = function () use (&$recursive){
// The function is now available as $recursive
}
?>
This DOES NOT WORK
<?php
$recursive = function () use ($recursive){
// The function is now available as $recursive
}
?>
--was--
To recursively call a closure, use this code.
$recursive = function () use (&$recursive){
// The function is now available as $recursive
}
This DOES NOT WORK
$recursive = function () use ($recursive){
// The function is now available as $recursive
}
http://php.net/manual/en/functions.anonymous.php