each_binary_safety.phpt 414 B

1234567891011121314
  1. --TEST--
  2. Binary safety of each() for both keys and values
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. $arr = array ("foo\0bar" => "foo\0bar");
  7. while (list($key, $val) = each($arr)) {
  8. echo strlen($key), ': ';
  9. echo urlencode($key), ' => ', urlencode($val), "\n";
  10. }
  11. ?>
  12. --EXPECTF--
  13. Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
  14. 7: foo%00bar => foo%00bar