Quoth Justin Martin on Pungenday, the 30th of Discord:
> If I recall correctly, you can use the 'use' keyword.
Thanks, Justin; that occurred to me, too. But the following results in
"Notice: Undefined variable: factorial":
$factorial = function($n) use ($factorial) {
if ($n == 1)
return 1;
else
return $n * $factorial($n - 1);
};
print $factorial(3);
and eventually "PHP Fatal error: Function name must be a string."
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php