On 30/06/2022 18:37, Arnaud Le Blanc wrote:
On jeudi 30 juin 2022 18:29:44 CEST Guilliam Xavier wrote:
Ah? Sorry, I had interpreted
https://github.com/php/php-src/pull/8330/files#diff-85701127596aca0e597bd796
1b5d59cdde4f6bb3e2a109a22be859ab7568b4d2R7318-R7320 as "capture the
*minimal* set of variables for *both* arrow functions and short closures",
but I was wrong?
No, you are right, the PR changes arrow functions too. But in the RFC we
decided to not touch the arrow functions for now.
Personally, I would be in favour of leaving the change in for arrow
functions as well. The fact that a variable of the same name, whose
value is never actually used, is captured by the closure, is to me a
bug, not a feature.
It's hard to even contrive an example where this is observable, so I
highly doubt anyone is relying on it.
Regards,
--
Rowan Tommins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php