Illegal [,] is allowed in psysh
Closed this issue · 5 comments
zhujinxuan commented
Hi, the following sentence is allowed in psysh but disallowed in php -a:
$a = [,];
In php 7.3.0, it will give an error that
php > $a = [,];
PHP Fatal error: Cannot use empty array elements in arrays in php shell code on line 1
Fatal error: Cannot use empty array elements in arrays in php shell code on line 1
GrahamCampbell commented
Is this supported in PHP 7.3?
GrahamCampbell commented
Sorry, I meant 7.2.
bobthecow commented
zhujinxuan commented
I see. Perhaps there are also similar trialing comma problems in PHP-Parser and tolerant-PHP-Parser php/php-langspec#229
I will submit PRs about that to PHP-parser before Christmas, then we can see whether the problem is fixed by a simple update.
bobthecow commented
Since this is an issue in PHP-Parser, closing this one in favor of nikic/PHP-Parser#561 :)