#46600 [Opn->Ver]: "_empty_" key in objects (see #41504)
| From: | jani@php.net | Date: | Tue, 18 Nov 2008 10:57:37 +0000 |
| Subject: | #46600 [Opn->Ver]: "_empty_" key in objects (see #41504) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131065@lists.php.net to get a copy of this message | ||
ID: 46600
Updated by: jani@php.net
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