php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73525 Not all JSON_ERROR_* constants are documented
Submitted: 2016-11-15 09:40 UTC Modified: 2016-11-15 11:57 UTC
From: mfischer@php.net Assigned: cmb (profile)
Status: Closed Package: JSON related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2016-11-15 09:40 UTC] mfischer@php.net
Description:
------------
Looking at http://php.net/manual/en/function.json-last-error.php ,
right now the following constants are documented:

JSON_ERROR_NONE
JSON_ERROR_DEPTH
JSON_ERROR_STATE_MISMATCH
JSON_ERROR_CTRL_CHAR
JSON_ERROR_SYNTAX
JSON_ERROR_UTF8
JSON_ERROR_RECURSION
JSON_ERROR_INF_OR_NAN
JSON_ERROR_UNSUPPORTED_TYPE

Using PHP 7.0.12 (sorry, don't have 7.0.13 which was already released)
I see two more (at the end):

$ php -r 'var_dump(get_defined_constants());' | grep JSON_ERROR_
  ["JSON_ERROR_NONE"]=>
  ["JSON_ERROR_DEPTH"]=>
  ["JSON_ERROR_STATE_MISMATCH"]=>
  ["JSON_ERROR_CTRL_CHAR"]=>
  ["JSON_ERROR_SYNTAX"]=>
  ["JSON_ERROR_UTF8"]=>
  ["JSON_ERROR_RECURSION"]=>
  ["JSON_ERROR_INF_OR_NAN"]=>
  ["JSON_ERROR_UNSUPPORTED_TYPE"]=>
  ["JSON_ERROR_INVALID_PROPERTY_NAME"]=>
  ["JSON_ERROR_UTF16"]=>


Testing with https://3v4l.org/niJ9G it seems there are now constants introduced
with PHP7


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-15 11:41 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: *General Issues +Package: JSON related -Assigned To: +Assigned To: cmb
 [2016-11-15 11:41 UTC] cmb@php.net
Indeed, JSON_ERROR_INVALID_PROPERTY_NAME and JSON_ERROR_UTF16 have
been introduced to fix bug #68546 and bug #62010, respectively,
are available as of PHP 7.0.0 and not yet documented.
 [2016-11-15 11:56 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=341024
Log: Fix #73525: Not all JSON_ERROR_* constants are documented
 [2016-11-15 11:57 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2016-11-15 11:57 UTC] cmb@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.
 [2020-02-07 06:06 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=0e75cfe1a9c5339e4d7e227f714ded06f088a2fd
Log: Fix #73525: Not all JSON_ERROR_* constants are documented
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 09:01:30 2024 UTC