blob: 28bc56c1c702b53278d8956d2b16c9b091dba5ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--TEST--
Bug #41504 (json_decode() converts empty array keys to "_empty_")
--FILE--
<?php
var_dump(json_decode('{"":"value"}', true));
var_dump(json_decode('{"":"value", "key":"value"}', true));
var_dump(json_decode('{"key":"value", "":"value"}', true));
echo "Done\n";
?>
--EXPECT--
array(1) {
[""]=>
string(5) "value"
}
array(2) {
[""]=>
string(5) "value"
["key"]=>
string(5) "value"
}
array(2) {
["key"]=>
string(5) "value"
[""]=>
string(5) "value"
}
Done
|