#49133 [NEW]: json_decode - return value on failure
| From: | php at jasonstark dot com | Date: | Sun, 02 Aug 2009 05:09:22 +0000 |
| Subject: | #49133 [NEW]: json_decode - return value on failure | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-2592@lists.php.net to get a copy of this message | ||
From: php at jasonstark dot com
Operating system: N/A
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: json_decode - return value on failure
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 bug report at http://bugs.php.net/?id=49133&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49133&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49133&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49133&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49133&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49133&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49133&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49133&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49133&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49133&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49133&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49133&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49133&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49133&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49133&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49133&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49133&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49133&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49133&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49133&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49133&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49133&r=mysqlcfg