]> granicus.if.org Git - php/commitdiff
MFH
authorfoobar <sniper@php.net>
Thu, 24 Jul 2003 10:42:17 +0000 (10:42 +0000)
committerfoobar <sniper@php.net>
Thu, 24 Jul 2003 10:42:17 +0000 (10:42 +0000)
ext/standard/tests/array/bug14580.phpt
tests/lang/bug24783.phpt

index ddf467a53bc0bba97870def0cbb55e0122cb6708..8a80bddcb40ce98621652e0d7e6d6336e5eed465 100644 (file)
@@ -3,13 +3,9 @@ Bug #14580 (key() not binary safe)
 --FILE--
 <?php
        $arr = array ("foo\0bar" => "foo\0bar");
-       print_r($arr);
        $key = key($arr);
-       echo strlen($key), ': ', $key, "\n";
+       echo strlen($key), ': ';
+       echo urlencode($key), "\n";
 ?>
 --EXPECT--
-Array
-(
-    [foobar] => foobar
-)
-7: foobar
+7: foo%00bar
index 4b5fa4f229e6641a3c5fc2837c24475bd2e1ffd7..8c8cd6ee0107720181e5c6d15c7b8f5e4fa84f24 100644 (file)
@@ -5,8 +5,9 @@ Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)")
 error_reporting(E_ALL);
        $arr = array ("foo\0bar" => "foo\0bar");
        foreach ($arr as $key => $val) {
-               echo strlen($key), ": $key => $val\n";
+               echo strlen($key), ': ';
+               echo urlencode($key), ' => ', urlencode($val), "\n";
        }
 ?>
 --EXPECT--
-7: foobar => foobar
+7: foo%00bar => foo%00bar