1--TEST-- 2mb_parse_str() 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", 13 "%2bfoo=def&-bar=jkl", 14 "foo[]=abc&foo[]=def&foo[]=ghi&bar[]=jkl" 15); 16function test($query) { 17 $foo = ''; 18 $bar = ''; 19 mb_parse_str($query, $array); 20 var_dump($array); 21 var_dump($foo); 22 var_dump($bar); 23 mb_parse_str($query); 24 var_dump($foo); 25 var_dump($bar); 26} 27foreach ($queries as $query) { 28 test($query); 29} 30?> 31--EXPECTF-- 32array(2) { 33 ["foo"]=> 34 string(3) "abc" 35 ["bar"]=> 36 string(3) "def" 37} 38string(0) "" 39string(0) "" 40 41Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d 42string(3) "abc" 43string(3) "def" 44array(2) { 45 ["+foo"]=> 46 string(3) "def" 47 ["-bar"]=> 48 string(3) "jkl" 49} 50string(0) "" 51string(0) "" 52 53Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d 54string(0) "" 55string(0) "" 56array(2) { 57 ["foo"]=> 58 array(3) { 59 [0]=> 60 string(3) "abc" 61 [1]=> 62 string(3) "def" 63 [2]=> 64 string(3) "ghi" 65 } 66 ["bar"]=> 67 array(1) { 68 [0]=> 69 string(3) "jkl" 70 } 71} 72string(0) "" 73string(0) "" 74 75Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d 76array(3) { 77 [0]=> 78 string(3) "abc" 79 [1]=> 80 string(3) "def" 81 [2]=> 82 string(3) "ghi" 83} 84array(1) { 85 [0]=> 86 string(3) "jkl" 87} 88