summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-07-24 10:25:15 +0000
committerfoobar <sniper@php.net>2003-07-24 10:25:15 +0000
commitdcfe901015c46688599b34e0e0572ec88eb18d93 (patch)
tree98e876dac40263d90ccdf9e4e2c2a2fbdc8c35e3 /tests
parent760fe8e92368e5c961ef5d854987139729da4d52 (diff)
downloadphp-git-dcfe901015c46688599b34e0e0572ec88eb18d93.tar.gz
test for bug 24783 (foreach() key not binary safe)
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/bug24783.phpt12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt
new file mode 100644
index 0000000000..4b5fa4f229
--- /dev/null
+++ b/tests/lang/bug24783.phpt
@@ -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