Annotation of embedaddon/php/ext/mbstring/tests/mb_parse_str02.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: mb_parse_str() test 2
3: --SKIPIF--
4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
1.1.1.2 ! misho 5: --FAIL--
! 6: register_globals calls killed the ability for mb_parse_str() to register into the global scope
1.1 misho 7: --INI--
8: arg_separator.input=&#
9: --FILE--
10: <?php
11: $queries = array(
12: "foo=abc#bar=def&fubar=ghi",
13: "%2bfoo=def&-bar=jkl#+fubar",
14: " foo[]=abc&foo[]=def#foo[]=ghi#bar[]=#foo[]&fubar[]=="
15: );
16: function test($query) {
17: $foo = '';
18: $bar = '';
19: $fubar = '';
20: mb_parse_str($query, $array);
21: var_dump($array);
22: var_dump($foo);
23: var_dump($bar);
24: var_dump($fubar);
25: mb_parse_str($query);
26: var_dump($foo);
27: var_dump($bar);
28: var_dump($fubar);
29: }
30: foreach ($queries as $query) {
31: test($query);
32: }
33: ?>
34: --EXPECT--
35: array(3) {
36: ["foo"]=>
37: string(3) "abc"
38: ["bar"]=>
39: string(3) "def"
40: ["fubar"]=>
41: string(3) "ghi"
42: }
43: string(0) ""
44: string(0) ""
45: string(0) ""
46: string(3) "abc"
47: string(3) "def"
48: string(3) "ghi"
49: array(3) {
50: ["+foo"]=>
51: string(3) "def"
52: ["-bar"]=>
53: string(3) "jkl"
54: ["fubar"]=>
55: string(0) ""
56: }
57: string(0) ""
58: string(0) ""
59: string(0) ""
60: string(0) ""
61: string(0) ""
62: string(0) ""
63: array(3) {
64: ["foo"]=>
65: array(4) {
66: [0]=>
67: string(3) "abc"
68: [1]=>
69: string(3) "def"
70: [2]=>
71: string(3) "ghi"
72: [3]=>
73: string(0) ""
74: }
75: ["bar"]=>
76: array(1) {
77: [0]=>
78: string(0) ""
79: }
80: ["fubar"]=>
81: array(1) {
82: [0]=>
83: string(1) "="
84: }
85: }
86: string(0) ""
87: string(0) ""
88: string(0) ""
89: array(4) {
90: [0]=>
91: string(3) "abc"
92: [1]=>
93: string(3) "def"
94: [2]=>
95: string(3) "ghi"
96: [3]=>
97: string(0) ""
98: }
99: array(1) {
100: [0]=>
101: string(0) ""
102: }
103: array(1) {
104: [0]=>
105: string(1) "="
106: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>