|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-18 21:41 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 16:00:02 2025 UTC |
Description: ------------ json_decode() fails completely on the following code: Reproduce code: --------------- var_dump(json_decode('[{0:"tan","model":"sedan"},{"0":"red",model:"sports"}]')); var_dump(json_decode('{"1":"one",2:"two","5":\'fi"ve\'}')); Expected result: ---------------- array(2) { [0]=> object(stdClass)(2) { [0]=> string(3) "tan" ["model"]=> string(5) "sedan" } [1]=> object(stdClass)(2) { [0]=> string(3) "red" ["model"]=> string(6) "sports" } } object(stdClass)(3) { [1]=> string(3) "one" [2]=> string(3) "two" [5]=> string(5) "fi"ve" } Actual result: -------------- NULL NULL