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.
 
 

31 lines
566 B

--TEST--
Bug #12776 (array_walk crash)
--SKIPIF--
<?php
if (true) die("skip AOT does not support undefined variables");
?>
--FILE--
<?php
function test($val, $key)
{
global $globalArray;
$globalArray[] = $key;
// this will end up crashing
$globalArray[] = (string) $key;
// this will end up OK
print "val: {$val}; key: {$key}\n";
flush();
}
function main()
{
$arr = array('k' => 'v');
array_walk($arr, 'test');
print "First value: " . $globalArray[0];
print "\nDone\n";
}
?>
--EXPECT--
val: v; key: k
First value: k
Done