php-src/Zend/tests/list/list_reference_009.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

48 lines
533 B
PHP

--TEST--
"Reference Unpacking - VM Safety" list()
--FILE--
<?php
$ary = [[0, 1]];
[[
0 => &$a,
($ary["foo"] = 1) => &$b
]] = $ary;
var_dump($ary, $a, $b);
unset($ary, $a, $b);
$ary = [[0, 1]];
[
0 => &$a,
($ary["foo"] = 1) => &$b
] = $ary[0];
var_dump($ary, $a, $b);
?>
--EXPECT--
array(2) {
[0]=>
array(2) {
[0]=>
&int(0)
[1]=>
&int(1)
}
["foo"]=>
int(1)
}
int(0)
int(1)
array(2) {
[0]=>
array(2) {
[0]=>
&int(0)
[1]=>
&int(1)
}
["foo"]=>
int(1)
}
int(0)
int(1)