|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-05-23 09:57 UTC] p dot scheit at ps-webforge dot com
[2015-12-23 23:13 UTC] ajf@php.net
-Status: Open
+Status: Duplicate
[2015-12-23 23:13 UTC] ajf@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
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)