var_dump(json_decode('{ "": { "": "" }'));
var_dump(json_decode('{ "": "": "" } }'));
-echo "Done\n";
?>
+===DONE===
--EXPECTF--
Warning: json_decode() expects at least 1 parameter, 0 given in %s on line %d
NULL
NULL
NULL
NULL
-object(stdClass)#1 (1) {
+object(stdClass)#%d (1) {
["test"]=>
- object(stdClass)#2 (1) {
+ object(stdClass)#%d (1) {
["foo"]=>
string(3) "bar"
}
}
-object(stdClass)#1 (1) {
+object(stdClass)#%d (1) {
["test"]=>
- object(stdClass)#2 (1) {
+ object(stdClass)#%d (1) {
["foo"]=>
string(0) ""
}
}
-object(stdClass)#1 (1) {
+object(stdClass)#%d (1) {
["_empty_"]=>
- object(stdClass)#2 (1) {
+ object(stdClass)#%d (1) {
["foo"]=>
string(0) ""
}
}
-object(stdClass)#1 (1) {
+object(stdClass)#%d (1) {
["_empty_"]=>
- object(stdClass)#2 (1) {
+ object(stdClass)#%d (1) {
["_empty_"]=>
string(0) ""
}
}
NULL
NULL
-Done
+===DONE===
--TEST--
Bug #46215 (json_encode mutates its parameter and has some class-specific state)
+--SKIPIF--
+<?php
+if (!extension_loaded("json")) {
+ die('skip JSON extension not available in this build');
+}
+?>
--FILE--
<?php