php-src/tests/lang/each_binary_safety.phpt

14 lines
302 B
Plaintext
Raw Normal View History

2003-07-24 13:08:35 +00:00
--TEST--
Binary safety of each() for both keys and values
--FILE--
<?php
error_reporting(E_ALL);
2006-12-06 13:11:02 +00:00
$arr = array (b"foo\0bar" => b"foo\0bar");
2003-07-24 13:08:35 +00:00
while (list($key, $val) = each($arr)) {
echo strlen($key), ': ';
echo urlencode($key), ' => ', urlencode($val), "\n";
}
?>
--EXPECT--
7: foo%00bar => foo%00bar