note 92003 deleted from functions.anonymous by danbrown
| From: | danbrown@php.net | Date: | Sat, 04 Jul 2009 16:01:57 +0000 |
| Subject: | note 92003 deleted from functions.anonymous by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157917@lists.php.net to get a copy of this message | ||
Note Submitter: nash at nashweb dot de
----
This works:
<?php
function returnsAFunc()
{
print "returns A Func called";
return function()
{
print "within return val";
};
}
$x = returnsAFunc();
$x();
?>
This does NOT work:
<?php
function returnsAFunc()
{
print "returns A Func called";
return function()
{
print "within return val";
};
}
returnsAFunc()(); // parse error
?>
(Using PHP 5.3)