Re: [RFC] Draft - Closure self reference
| From: | Hans Henrik Bergan | Date: | Wed, 11 Nov 2020 20:01:59 +0000 |
| Subject: | Re: [RFC] Draft - Closure self reference | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112229@lists.php.net to get a copy of this message | ||
if i have understood the "as"-suggestion correctly:
$fn = function() as $lambdaOrAnyName {var_dump($lambdaOrAnyName);};
(function() as $lambdaOrAnyName{var_dump($lambdaOrAnyName);})();
then that syntax is fine with me. this is also very close to how it
works in JavaScript (except the "as" part),
i like the as-suggestion better than the $lambda suggestion in current
RFC-draft,
it has 0 bc break and people who want to call it $lambda can simply do
function() as $lamda{};