[php-langspec][Issue #235] - yield and array initializer precedence not specified correctly
[email protected] Fri, 15 Mar 2019 08:50:27 +0000
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
You can view the Issue on github: https://github.com/php/php-langspec/issues/235 Opened By: nikic Issue Description: Split off from #208: Currently [array-element-initializer](https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#grammar-array-element-initializer) specifies that the key and value are both ordinary expressions. As specified, this is ambiguous with [yield-expression](https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#grammar-yield-expression). PHP resolves this as follows: ```php [yield "foo" => "bar"] // is [(yield "foo" => "bar")] // rather than [(yield "foo") => "bar"] ``` However, I'm not sure how this can be specified in grammar form.