php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65803 JSON errors missing a value
Submitted: 2013-10-01 19:14 UTC Modified: 2013-10-01 19:51 UTC
From: jsnell at e-normous dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.5.4 OS: n/a
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jsnell at e-normous dot com
New email:
PHP Version: OS:

 

 [2013-10-01 19:14 UTC] jsnell at e-normous dot com
Description:
------------
---
From manual page: http://www.php.net/function.json-last-error#refsect1-
function.json-last-error-returnvalues
---
JSON_ERROR_RECURSION is missing from the list of constants in  json_last_error()


The constant seems to be defined as 6 in my PHP build (PHP 5.5.3-1) and the test 
script returns a value of 6.  

Test script:
---------------
$foo = new stdClass();
$bar = new stdClass();
$foo->bar = $bar;
$bar->foo = $foo; 
var_dump(json_encode($foo));
var_dump(json_last_error());

int(6)
Recursion detected

Expected result:
----------------
JSON_ERROR_RECURSION would be defined on http://www.php.net/function.json-last-
error



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-01 19:51 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=331633
Log: Document the new JSON error constants in PHP 5.5, since the naughty person who
implemented them didn't add them to UPGRADING. :)

Fixes doc bug #65803 (JSON errors missing a value).
 [2013-10-01 19:51 UTC] aharvey@php.net
-Status: Open +Status: Closed -Package: json +Package: Documentation problem -Assigned To: +Assigned To: aharvey
 [2013-10-01 19:51 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 14:00:01 2026 UTC