Doc #52313 [Opn->Csd]: Missing JSON_ERROR_STATE_MISMATCH in json_last_error() documentation
| From: | philip@php.net | Date: | Tue, 10 Aug 2010 00:44:55 +0000 |
| Subject: | Doc #52313 [Opn->Csd]: Missing JSON_ERROR_STATE_MISMATCH in json_last_error() documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4822@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52313&edit=1
ID: 52313
Updated by: philip@php.net
Reported by: jerome dot auge at anakeen dot com
Summary: Missing JSON_ERROR_STATE_MISMATCH in
json_last_error() documentation
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.2
-Assigned To:
+Assigned To: philip
Block user comment: N
New Comment:
Fixed in SVN, thanks for the report! :) The fix will show up online this
upcoming
Friday. Also, this is related to PHP bug #52391
Previous Comments:
------------------------------------------------------------------------
[2010-08-10 02:43:05] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=302054
Log: Improved wording to describe JSON_ERROR_STATE_MISMATCH, as per PHP
bug #52313 (via jerome dot auge at anakeen dot com)
------------------------------------------------------------------------
[2010-07-12 10:51:25] jerome dot auge at anakeen dot com
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--
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52313&edit=1