php-src/Zend/tests/gh11320_3.phpt
Ilija Tovilo 8ed66b4347 Add tests for list() in assignment in array literals
Array literals will constant evaluate their elements. These can include
assignments, even though these are not valid constant expressions. The lhs of
assignments can be a list() element (or []) which is parsed as an array with a
special flag.
2023-05-26 12:15:01 +02:00

9 lines
187 B
PHP

--TEST--
GH-11320: list() must not appear as a standalone array element
--FILE--
<?php
[list($a)];
?>
--EXPECTF--
Fatal error: Cannot use list() as standalone expression in %s on line %d