|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-10 02:43 UTC] philip@php.net
[2010-08-10 02:44 UTC] philip@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: philip
[2010-08-10 02:44 UTC] philip@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 20:00:02 2026 UTC |
Description: ------------ The json_last_error() documentation lacks the JSON_ERROR_STATE_MISMATCH constant in the list of possible returned values. Test script: --------------- The error code '2' returned by a json_decode() of a malformed JSON string (Ex. '{"foo":"bar"}}' with double '}' at end) is not known by the constants shown in the documentation. A glimpse in the source code, shows that there is another constant 'JSON_ERROR_STATE_MISMATCH' that matches the error code '2'. Expected result: ---------------- --8<-- JSON_ERROR_NONE No error has occurred JSON_ERROR_DEPTH The maximum stack depth has been exceeded JSON_ERROR_STATE_MISMATCH Invalid or malformed JSON JSON_ERROR_CTRL_CHAR Control character error, possibly incorrectly encoded JSON_ERROR_SYNTAX Syntax error JSON_ERROR_UTF8 Malformed UTF-8 characters, possibly incorrectly encoded PHP 5.3.1 -->8--