]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Wed, 4 Dec 2002 17:01:08 +0000 (17:01 +0000)
committerSVN Migration <svn@php.net>
Wed, 4 Dec 2002 17:01:08 +0000 (17:01 +0000)
ext/standard/tests/array/bug12776.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug12776.phpt b/ext/standard/tests/array/bug12776.phpt
new file mode 100644 (file)
index 0000000..54c6f6f
--- /dev/null
@@ -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