From: Matt at mpcm dot com Operating system: Ubuntu PHP version: 5.3.0alpha2 PHP Bug Type: JSON related Bug description: "_empty_" key in objects (see #41504)
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 bug report at http://bugs.php.net/?id=46600&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46600&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46600&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46600&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46600&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46600&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46600&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46600&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46600&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46600&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46600&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46600&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46600&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46600&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46600&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46600&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46600&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46600&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46600&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46600&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46600&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46600&r=mysqlcfg
