mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
8ed66b4347
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.
9 lines
187 B
PHP
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
|