1--TEST--
2mb_parse_str() test 2
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--FAIL--
6register_globals calls killed the ability for mb_parse_str() to register into the global scope
7--INI--
8arg_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);
16function 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}
30foreach ($queries as $query) {
31	test($query);
32}
33?>
34--EXPECTF--
35array(3) {
36  ["foo"]=>
37  string(3) "abc"
38  ["bar"]=>
39  string(3) "def"
40  ["fubar"]=>
41  string(3) "ghi"
42}
43string(0) ""
44string(0) ""
45string(0) ""
46
47Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
48string(3) "abc"
49string(3) "def"
50string(3) "ghi"
51array(3) {
52  ["+foo"]=>
53  string(3) "def"
54  ["-bar"]=>
55  string(3) "jkl"
56  ["fubar"]=>
57  string(0) ""
58}
59string(0) ""
60string(0) ""
61string(0) ""
62
63Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
64string(0) ""
65string(0) ""
66string(0) ""
67array(3) {
68  ["foo"]=>
69  array(4) {
70    [0]=>
71    string(3) "abc"
72    [1]=>
73    string(3) "def"
74    [2]=>
75    string(3) "ghi"
76    [3]=>
77    string(0) ""
78  }
79  ["bar"]=>
80  array(1) {
81    [0]=>
82    string(0) ""
83  }
84  ["fubar"]=>
85  array(1) {
86    [0]=>
87    string(1) "="
88  }
89}
90string(0) ""
91string(0) ""
92string(0) ""
93
94Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
95array(4) {
96  [0]=>
97  string(3) "abc"
98  [1]=>
99  string(3) "def"
100  [2]=>
101  string(3) "ghi"
102  [3]=>
103  string(0) ""
104}
105array(1) {
106  [0]=>
107  string(0) ""
108}
109array(1) {
110  [0]=>
111  string(1) "="
112}
113