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.
 
 

29 lines
548 B

--TEST--
closure function with ref parameter
--SKIPIF--
<?php die('skip'); ?>
--FILE--
<?php
//function main()
//{
// $s = "foo";
// $testFn = function (&$data) {
// $data .= " bar";
// };
// $testFn($s);
// var_dump($s);
//}
function main()
{
$testFn = function (&$data) {
$data .= " (_)";
};
$sweet = array('a' => 'apple', 'b' => 'banana');
$fruits = array('sweet' => $sweet, 'sour' => 'lemon');
array_walk_recursive($fruits, $testFn);
var_dump($fruits);
}
?>
--EXPECT--
string(7) "foo bar"