TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
646 B
37 lines
646 B
--TEST--
|
|
Bug #72622 (array_walk + array_replace_recursive create references from nothing)
|
|
--SKIPIF--
|
|
<?php
|
|
if (true) die("skip AOT does not support reference parameters in closures");
|
|
?>
|
|
|
|
--FILE--
|
|
<?php
|
|
function walk(array $arr)
|
|
{
|
|
array_walk($arr, function (&$val, $name) {
|
|
});
|
|
return $arr;
|
|
}
|
|
function main()
|
|
{
|
|
$arr3 = ['foo' => 'foo'];
|
|
$arr4 = walk(['foo' => 'bar']);
|
|
$arr5 = array_replace_recursive($arr3, $arr4);
|
|
$arr5['foo'] = 'baz';
|
|
var_dump($arr3, $arr4, $arr5);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
array(1) {
|
|
["foo"]=>
|
|
string(3) "foo"
|
|
}
|
|
array(1) {
|
|
["foo"]=>
|
|
string(3) "bar"
|
|
}
|
|
array(1) {
|
|
["foo"]=>
|
|
string(3) "baz"
|
|
}
|
|
|