On Wed, May 31, 2017 at 7:36 AM, Rowan Collins <rowan.coll...@gmail.com> wrote: > On 30 May 2017 18:58:14 BST, Levi Morrison <le...@php.net> wrote: >>Internals, >> >>The previous discussion thread has died down significantly and so I'd >>like to start a new one to refocus. This message has some redundant >>information by design so people don't have to reference the other >>thread so much. >> >>Based on the discussion there are a few different syntax choices >>people liked. Overall it's a feature that people seem to want but >>everyone seems to prefer a different syntax choice. > > I was just pondering alternative approaches to stop the => token being > ambiguous, and wondered if surrounding the whole expression with braces could > work: > > { => $bound * 2 } > { $a, $b => $a * $b } > > I believe this eliminates the ambiguity with array notation, and is more > concise than pretty much every alternative. I'm my opinion, grouping the > arguments and body would make it more readable in context, as well.
This does not work. We permit expressions as statements and we also allow empty blocks: { $a = $foo; } These will conflict in the grammar. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php