#49133 [Opn->Csd]: json_decode - return value on failure

From: Date: Mon, 03 Aug 2009 12:16:14 +0000
Subject: #49133 [Opn->Csd]: json_decode - return value on failure
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2595@lists.php.net to get a copy of this message
ID: 49133 Updated by: rquadling@php.net Reported By: php at jasonstark dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: N/A PHP Version: Irrelevant New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2009-08-03 12:15:33] svn@php.net Automatic comment from SVN on behalf of rquadling Revision: http://svn.php.net/viewvc/?view=revision&revision=286730 Log: Return type will be null, not false, when an error occurs. Use json_last_error() to determine exact cause. Bug#49133. ------------------------------------------------------------------------ [2009-08-02 05:09:22] php at jasonstark dot com Description: ------------ The documentation for json_decode function doesn't explicitly state what happens or what the return value is when an invalid json string is passed in. Reproduce code: --------------- --- From manual page: function.json-decode --- Expected result: ---------------- Could you add a statement to the documentation for json_decode - Return Values: "Returns NULL when string cannot be parsed"? Thanks! Actual result: -------------- It doesn't say what happens. Example #3 alludes to the fact but it would be very helpful if it were included in the description above. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49133&edit=1

« previous php.doc.bugs (#2595) next »