#46600 [NEW]: "_empty_" key in objects (see #41504)
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
Thread (24 messages)
- Matt at mpcm dot com
- jani@php.net#46600 [Opn->Ver]: "_empty_" key in objects (see #41504)
- matt at mpcm dot com#46600 [Com]: "_empty_" key in objects (see #41504)
- matt at mpcm dot com#46600 [Com]: "_empty_" key in objects (see #41504)
- magicaltux@php.net#46600 [Ver]: "_empty_" key in objects (see #41504)
- Matt at mpcm dot com#46600 [Ver]: "_empty_" key in objects (see #41504)
- scottmac@php.net#46600 [Ver]: "_empty_" key in objects (see #41504)
- scottmac@php.net#46600 [Ver->Fbk]: "_empty_" key in objects (see #41504)
- matt at mpcm dot com#46600 [Com]: "_empty_" key in objects (see #41504)
- michaeldnelson dot mdn at gmail dot com#46600 [Com]: "_empty_" key in objects (see #41504)
- scottmac@php.net#46600 [NoF]: "_empty_" key in objects (see #41504)
- matt at mpcm dot comBug #46600 [Com]: "_empty_" key in objects (see #41504)
- matt at mpcm dot comBug #46600 [Com]: "_empty_" key in objects (see #41504)
- matt at mpcm dot comBug #46600 [Com]: "_empty_" key in objects (see #41504)
- ajf@php.netBug #46600 [NoF]: "_empty_" key in objects (see #41504)
- ofbeaton at gmail dot comBug #46600 [Com]: "_empty_" key in objects (see #41504)
- yohgaki@php.netBug #46600 [NoF]: "_empty_" key in objects (see #41504)
- matt at mpcm dot comBug #46600 [Com]: "_empty_" key in objects (see #41504)
- yohgaki@php.netBug #46600 [NoF->ReO]: "_empty_" key in objects (see #41504)
- matt at mpcm dot comReq #46600 [Com]: "_empty_" key in objects (see #41504)
- bukka@php.netReq #46600 [ReO]: "_empty_" key in objects (see #41504)
- bukka@php.netReq #46600 [ReO->Csd]: "_empty_" key in objects (see #41504)
- bukka@php.netReq #46600 [Csd]: "_empty_" key in objects (see #41504)
- aleksey dot moskovchenko at gmail dot comReq #46600 [Com]: "_empty_" key in objects (see #41504)