mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
This code path is reachable for all assignments expressions, not just true variable expressions. Really surprising we have no tests that caught this.
21 lines
275 B
PHP
21 lines
275 B
PHP
--TEST--
|
|
Failed assertion for assignment in expression context
|
|
--CREDITS--
|
|
Matteo Beccati (mbeccati)
|
|
--FILE--
|
|
<?php
|
|
|
|
function foo() {
|
|
return ['bar' => 'baz'];
|
|
}
|
|
|
|
var_dump(($v = foo())['bar'], $v);
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(3) "baz"
|
|
array(1) {
|
|
["bar"]=>
|
|
string(3) "baz"
|
|
}
|