Levi Morrison wrote on 01/10/2015 04:06:
I'm going to ask everyone to stop saying that auto-closing is bad
unless they also provide a demonstration of why it was bad.

Please see my e-mail from last night, or Rasmus's in the original thread. It is "bad" (or, controversial) because it is a fundamental change to PHP's scoping rules, which currently treat all variables denoted by "$foo" as local to the current function, without exception.

I'm also going to ask everyone to stop suggesting new syntax for
importing variables. If use() is a pain then auto-importing the used
variables is a good solution. If it's not a pain why are you
suggesting new syntax?

Because the feature is being described as "short closures", or as a new syntax, so people are looking for ways to make closures shorter without changing the functionality.

If auto-capture is the main feature you are interested in, and syntax just a by-product, then it might be sensible to make that clear. As a straw man, it would be possible to have auto-capture closures with no new syntax at all, e.g. function($x) use(*) { return $x * $y; }

It's perfectly reasonable to want both a shorter syntax and a different capture behaviour; but it also seems perfectly reasonable to want a shorter syntax with the same functionality as the current one, just as we have with [] vs array().

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to