php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63383 json_encode options bitmask
Submitted: 2012-10-29 10:09 UTC Modified: 2012-11-06 05:19 UTC
From: raul dot ferras at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: raul dot ferras at gmail dot com
New email:
PHP Version: OS:

 

 [2012-10-29 10:09 UTC] raul dot ferras at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.json-encode
---
There is no explanation about what does every option bitmask but only examples about their different output.

Expected result:
----------------
Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT, JSON_UNESCAPED_UNICODE. 

* JSON_HEX_QUOT: Encodes '"' into ....
* JSON_HEX_TAG: Encodes '<' and '>' into ....
....

Actual result:
--------------
Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT, JSON_UNESCAPED_UNICODE. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-31 20:22 UTC] mail+php at requinix dot net
And while we're on that page the example doesn't include a demo of NUMERIC_CHECK, 
PRETTY_PRINT, or UNESCAPED_SLASHES.

Did you know you can easily submit changes to the online documentation? Look for 
the [edit] link in the top-right corner of manual pages.

Here's a patch with the additions:
"json_encode: explain constants, show new ones (bug #63383)"
http://edit.php.net/?patchID=755&project=PHP
 [2012-11-06 05:19 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328253
Log: Add a link to the constants page from json_encode() and fix the title of the
example to indicate that we're not trying to show every single option.

Fixes doc bug #63383 (json_encode options bitmask).
 [2012-11-06 05:19 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.


 [2012-11-06 05:19 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 15:00:01 2026 UTC