RE: note 92873 rejected and deleted from function.json-encode by notes editor danbrown
| From: | Michael Geary | Date: | Wed, 12 Aug 2009 19:03:15 +0000 |
| Subject: | RE: note 92873 rejected and deleted from function.json-encode by notes editor danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159396@lists.php.net to get a copy of this message | ||
Hi, I am confused by this deletion.
I was replying to a note that had some completely incorrect information:
It's on this page:
http://us2.php.net/json_encode
And this note:
http://mike.eire.ca/
10-Aug-2009 08:54
The note says that json_encode does not always produce legal JSON, and it
says "According to the JSON spec, only objects and arrays can be
represented...".
That's completely wrong. The JSON spec *does* allow a number or a quoted
string (among other primitive types) to appear by itself, and json_encode
produces correct results for these values.
The "incorrect" examples given in that note are actually perfectly correct
behavior.
json_encode('foo') produces this JSON: "foo"
json_encode(23) produces this JSON: 23
Those are both correct, valid JSON output that will be accepted by any JSON
parser that conforms to the JSON spec.
As it sits right now, the note with completely wrong information is on the
page, and my note with the correct information has been deleted. I was
trying to correct this misleading note.
What did I do wrong? Is there a way I could have worded it better?
Thanks,
-Mike
> -----Original Message-----
> From: php-notes@lists.php.net [mailto:php-notes@lists.php.net]
> Sent: Wednesday, August 12, 2009 11:40 AM
> To: mg@mg.to
> Subject: note 92873 rejected and deleted from
> function.json-encode by notes editor danbrown
>
> You are receiving this email because your note posted to the
> online PHP manual has been removed by one of the editors.
>
> Read the following paragraphs carefully, because they contain
> pointers to resources better suited for requesting support or
> reporting bugs, none of which are to be included in manual
> notes because there are mechanisms and groups in place to
> deal with those issues.
>
> The user contributed notes are not an appropriate place to
> ask questions, report bugs or suggest new features; please
> use the resources listed on <http://php.net/support> for
> those purposes. This was clearly stated in the page you used
> to submit your note, please carefully re-read those
> instructions before submitting future contributions.
>
> Bug submissions and feature requests should be entered at
> <http://bugs.php.net/>. For documentation errors use the
> bug
> system, and classify the bug as "Documentation problem".
> Support and ways to find answers to your questions can be
> found at <http://php.net/support>.
>
> Your note has been removed from the online manual.
>
> ----- Copy of your note below -----
>
> I think you misunderstood the JSON spec. A simple number or
> double-quoted string *is* valid JSON. The json_encode
> function does produce valid JSON when you pass it a number of string.
>