Edit report at https://bugs.php.net/bug.php?id=62292&edit=1
ID: 62292
Updated by: [email protected]
Reported by: hosiplan at gmail dot com
Summary: Casting object to array brokes isset on numerical
keys
-Status: Open
+Status: Duplicate
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: 5.3.13
Block user comment: N
Private report: N
New Comment:
Duplicate of https://bugs.php.net/bug.php?id=66173
Previous Comments:
------------------------------------------------------------------------
[2013-05-23 09:57:13] p dot scheit at ps-webforge dot com
this seems to be a possible duplicate of https://bugs.php.net/bug.php?id=45959
------------------------------------------------------------------------
[2012-06-11 13:56:18] hosiplan at gmail dot com
Description:
------------
Casting object to array brokes isset on numerical keys
Test script:
---------------
$obj = json_decode('{"100":[10],"120":[20]}');
$map = (array)$obj;
var_dump(
isset($obj->{100}),
isset($obj->{"100"}),
isset($map[100]),
isset($map["100"])
);
Expected result:
----------------
bool(false)
bool(true)
bool(false)
bool(true)
Actual result:
--------------
bool(true)
bool(true)
bool(false)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62292&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.