mirror of
https://github.com/php/php-src.git
synced 2024-11-29 04:46:07 +08:00
Added a test for bug #12776
This commit is contained in:
parent
7b56bfae46
commit
cf0a0f0967
25
ext/standard/tests/array/bug12776.phpt
Normal file
25
ext/standard/tests/array/bug12776.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user