[php-langspec][Issue #227] - Array initializer does not include in ','
| From: | noreply@php.net | Date: | Thu, 20 Dec 2018 21:06:32 +0000 |
| Subject: | [php-langspec][Issue #227] - Array initializer does not include in ',' | ||
| Groups: | php.standards | ||
| Request: | Send a blank email to standards-+get-1350@lists.php.net to get a copy of this message | ||
You can view the Issue on github:
https://github.com/php/php-langspec/issues/227
Opened By: zhujinxuan
Issue Description:
In current PHP, the following code is legal:
```
$a = [,];
```
And the following code is legal in parser but illegal during runtime:
```
$a = [,,];
```
However, current
array-initializer in 10-expressions.md and
19-grammar.md does not include , as an element.
If we want to describe this behavior in the langspec, then we need to change the definition of
array-initializer to
```
array-initializer:
array-initializer-list ','?
','
```
I can submit a PR if you think it is good to support this current behavior.