Think the way it is implemented in JS is better than `$lambda` variable. At
least it doesn't have BC breaks (does it?)

On Tue, Nov 10, 2020, 7:38 PM Hans Henrik Bergan <divinit...@gmail.com>
wrote:

> something i'm missing from Javascript is the ability to give names to
> closures,
> this both gives closures the ability to reference themselves, but it
> also makes for meaningful stack traces, eg this is legal javascript:
>
> (function TheClosuresLocalName(){console.log(TheClosuresLocalName);
> throw new Error("look at my stacktrace!");})();
> - the name is optional, and only visible inside the closure itself,
> and unfortunately this is not legal in PHP, i wish it was.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>

Reply via email to