|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesjson-decode-warnings (last revision 2010-09-14 05:48 UTC by aharvey@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-13 21:49 UTC] kalle@php.net
[2010-09-13 22:03 UTC] pzbowen at gmail dot com
[2010-09-14 07:48 UTC] aharvey@php.net
[2010-09-14 07:48 UTC] aharvey@php.net
-Status: Open
+Status: Analyzed
[2010-09-14 07:48 UTC] aharvey@php.net
[2010-09-14 07:55 UTC] scottmac@php.net
-Status: Analyzed
+Status: Bogus
[2010-09-14 07:55 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 00:00:02 2025 UTC |
Description: ------------ According to RFC 4627, section 2.2, "The names within an object SHOULD be unique." This is only a SHOULD not a MUST, so the following is valid {"foo":2,"foo":3} Unfortunately in PHP this only returns the last object member. Test script: --------------- var_dump(json_decode('{"foo":2,"foo":3}')); Expected result: ---------------- an object with a way of accessing both members or an error raised by json_decode Actual result: -------------- object(stdClass)#1 (1) { ["foo"]=> int(3) }