mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00: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.
13 lines
251 B
PHP
13 lines
251 B
PHP
--TEST--
|
|
GH-11320: list() expressions can contain magic constants
|
|
--FILE--
|
|
<?php
|
|
[list(__FILE__ => $foo) = [__FILE__ => 'foo']];
|
|
var_dump($foo);
|
|
[[__FILE__ => $foo] = [__FILE__ => 'foo']];
|
|
var_dump($foo);
|
|
?>
|
|
--EXPECT--
|
|
string(3) "foo"
|
|
string(3) "foo"
|