x();
?>
---EXPECT--
+--EXPECTF--
+Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
array(2) {
[1]=>
string(0) ""
test();
?>
---EXPECT--
+--EXPECTF--
+Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
int(42)
foo();
?>
--EXPECTF--
+Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
+
Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_parse_str.php:3
Stack trace:
#0 %sthis_in_parse_str.php(3): parse_str('this=42')
return;
}
+ php_error_docref(NULL, E_DEPRECATED, "Calling parse_str() without the result argument is deprecated");
+
symbol_table = zend_rebuild_symbol_table();
ZVAL_ARR(&tmp, symbol_table);
sapi_module.treat_data(PARSE_STRING, res, &tmp);
parse_str("a=1&b=2&c=3");
var_dump($a, $b, $c);
?>
---EXPECT--
+--EXPECTF--
+Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
string(1) "1"
string(1) "2"
string(1) "3"
--EXPECTF--
*** Testing parse_str() : basic functionality ***
Basic test WITHOUT result arg
+
+Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
NULL
string(4) "val1"
string(4) "val2"
["third"]=>
string(4) "val3"
}
-===DONE===
\ No newline at end of file
+===DONE===
echo "*** Testing parse_str() : non-default arg_separator.input specified ***\n";
$s1 = "first=val1/second=val2/third=val3";
-var_dump(parse_str($s1));
-var_dump($first, $second, $third);
+var_dump(parse_str($s1, $result));
+var_dump($result);
?>
===DONE===
---EXPECTF--
+--EXPECT--
*** Testing parse_str() : non-default arg_separator.input specified ***
NULL
-string(4) "val1"
-string(4) "val2"
-string(4) "val3"
-===DONE===
\ No newline at end of file
+array(3) {
+ ["first"]=>
+ string(4) "val1"
+ ["second"]=>
+ string(4) "val2"
+ ["third"]=>
+ string(4) "val3"
+}
+===DONE===
echo "\nTest string with badly formed % numbers\n";
$str = "first=%41&second=%a&third=%b";
-var_dump(parse_str($str));
-var_dump($first, $second, $third);
+var_dump(parse_str($str, $res));
+var_dump($res);
echo "\nTest string with non-binary safe name\n";
$str = "arr.test[1]=sid&arr test[4][two]=fred";
Test string with badly formed % numbers
NULL
-string(1) "A"
-string(2) "%a"
-string(2) "%b"
+array(3) {
+ ["first"]=>
+ string(1) "A"
+ ["second"]=>
+ string(2) "%a"
+ ["third"]=>
+ string(2) "%b"
+}
Test string with non-binary safe name
NULL
}
}
}
-===DONE===
\ No newline at end of file
+===DONE===