#42001 [Opn->Bgs]: But it does not work!
| From: | tony2001@php.net | Date: | Mon, 16 Jul 2007 21:52:59 +0000 |
| Subject: | #42001 [Opn->Bgs]: But it does not work! | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969377058@lists.php.net to get a copy of this message | ||
ID: 42001
Updated by: tony2001@php.net
Reported By: stefan dot priebsch at e-novative dot de
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: irrelevant
PHP Version: Irrelevant
New Comment:
>json_encode() does not work with SimpleXML data that contains CDATA.
json_encode() encodes THE OBJECT, but you actually meant to encode IT'S
DATA. To do that you need to cast it to string, as I've said in the
original report.
>Either this is a bug in PHP (which you claim it is not, bogusifying
>my bug report) or the documentation is inaccurate.
The function works as expected and the docs are correct.
Please read what I'm writing to you.
We're not going to explain every possible user error in the docs, it
would take gigabytes otherwise.
Previous Comments:
------------------------------------------------------------------------
[2007-07-16 21:43:43] stefan dot priebsch at e-novative dot de
json_encode() does not work with SimpleXML data that contains CDATA.
Either this is a bug in PHP (which you claim it is not, bogusifying my
bug report) or the documentation is inaccurate.
As a PHP developer I don't really care wether SimpleXML data is
serialized to json_encode() it or not, I care wether the conversion
works for all types as the manual suggests - and it does not.
As you don't consider #41976 a bug in PHP, you should at least change
the manual. You can't just claim json_encode() works on any data type,
when it does not.
------------------------------------------------------------------------
[2007-07-16 09:06:15] tony2001@php.net
Please read the explanation in the original report, there is nothing
wrong in the docs.
------------------------------------------------------------------------
[2007-07-15 12:49:45] stefan dot priebsch at e-novative dot de
Description:
------------
The manual entry for json_encode() says the function works on any type
except a resource. This is not accurate. json_encode() does not work
properly on SimpleXML data that contains CDATA (see bug#41976).
Documentation should be changed to reflect this.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42001&edit=1