]> granicus.if.org Git - php/commitdiff
test for bug 24783 (foreach() key not binary safe)
authorfoobar <sniper@php.net>
Thu, 24 Jul 2003 10:25:15 +0000 (10:25 +0000)
committerfoobar <sniper@php.net>
Thu, 24 Jul 2003 10:25:15 +0000 (10:25 +0000)
tests/lang/bug24783.phpt [new file with mode: 0644]

diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt
new file mode 100644 (file)
index 0000000..4b5fa4f
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)")
+--FILE--
+<?php
+error_reporting(E_ALL);
+       $arr = array ("foo\0bar" => "foo\0bar");
+       foreach ($arr as $key => $val) {
+               echo strlen($key), ": $key => $val\n";
+       }
+?>
+--EXPECT--
+7: foobar => foobar