ID: 46600
Updated by: [EMAIL PROTECTED]
Reported By: Matt at mpcm dot com
-Status: Open
+Status: Verified
Bug Type: JSON related
-Operating System: Ubuntu
+Operating System: *
-PHP Version: 5.3.0alpha2
+PHP Version: 5CVS, 6CVS (2008-11-18)
Previous Comments:
------------------------------------------------------------------------
[2008-11-18 03:13:51] Matt at mpcm dot com
Description:
------------
json_decode() treats empty property name as "_empty_" not "". This was
fixed in #41504 for arrays, but not for objects. (seems to happen in PHP
Version 5.2.4-2ubuntu5.3 and 5.3.0alpha2.
Reproduce code:
---------------
<?
$s = '{"":"test"}';
var_dump(json_decode($s));
?>
Expected result:
----------------
object(stdClass)#1 (1) { [""]=> string(4) "test" }
Actual result:
--------------
object(stdClass)#2 (1) { ["_empty_"]=> string(4) "test" }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46600&edit=1