]> granicus.if.org Git - php/commitdiff
Add test for binary safety of each()
authorZeev Suraski <zeev@php.net>
Thu, 24 Jul 2003 13:08:35 +0000 (13:08 +0000)
committerZeev Suraski <zeev@php.net>
Thu, 24 Jul 2003 13:08:35 +0000 (13:08 +0000)
tests/lang/each_binary_safety.phpt [new file with mode: 0644]

diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt
new file mode 100644 (file)
index 0000000..bb13534
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+Binary safety of each() for both keys and values
+--FILE--
+<?php
+error_reporting(E_ALL);
+$arr = array ("foo\0bar" => "foo\0bar");
+while (list($key, $val) = each($arr)) {
+       echo strlen($key), ': ';
+       echo urlencode($key), ' => ', urlencode($val), "\n";
+}
+?>
+--EXPECT--
+7: foo%00bar => foo%00bar