Added a test for bug #12776

This commit is contained in:
Moriyoshi Koizumi 2002-12-04 17:01:07 +00:00
parent 7b56bfae46
commit cf0a0f0967

View File

@ -0,0 +1,25 @@
--TEST--
Bug #12776 (array_walk crash)
--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();
}
$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