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