diff options
Diffstat (limited to 'tests/lang/each_binary_safety.phpt')
-rw-r--r-- | tests/lang/each_binary_safety.phpt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt new file mode 100644 index 0000000..bb13534 --- /dev/null +++ b/tests/lang/each_binary_safety.phpt @@ -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 |