|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-09-04 15:58 UTC] nikic@php.net
-Assigned To:
+Assigned To: remi
[2013-09-04 15:58 UTC] nikic@php.net
[2013-09-04 16:03 UTC] remi@php.net
[2013-09-04 16:04 UTC] remi@php.net
-Status: Assigned
+Status: Closed
[2013-09-04 16:04 UTC] remi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
Description: ------------ It appears that json_decode is less strict in newer versions of PHP, and allows object keys to be single quoted. Test script: --------------- $ php -v PHP 5.5.3 (cli) (built: Aug 21 2013 17:57:15) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans $ php -r "var_dump(json_decode(\"{'a':1}\"));" class stdClass#1 (1) { public $a => int(1) } Expected result: ---------------- json_decode should return NULL and make the error available through json_last_error() Actual result: -------------- The string is parsed into an object