Issue: https://github.com/php/php-src/issues/8122
Author: manngo
### Description
The following code:
```php
<?php
$test = [
['a','b'],
['c','d'],
#['e','f'],
['g','h'],
];
print_r($test);
```
Resulted in this output:
<b>Parse error</b>: syntax error, unexpected single-quoted string "e"
in <b>…</b> on line <b>…</b>
But I expected this output instead:
```
Array
(
[0] => Array
(
[0] => a
[1] => b
)
[1] => Array
(
[0] => c
[1] => d
)
[2] => Array
(
[0] => g
[1] => h
)
)
```
That is, the #['e','f'] line cause an error. Somehow, PHP has
suddenly forgotten that # is a comment.
The version tested is 8.0.13.
Here are three things that worked:
- Use Version 7.2.2 instead
- Use # ['e','f'] (ie add a space after # in version
8.0.13
- Use //['e','f'] (ie use // with or without space) in
version 8.0.3
From the above I conclude that the described behaviour is unintended.
I was only able to test this on PHP 8.0.13 on Rocky Linux and PHP 7.2.2 on MacOS.
### PHP Version
PHP 8.0.13
### Operating System
Rocky Linux, MacOS