note 98273 deleted from function.json-decode by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 15:01:43 +0000 |
| Subject: | note 98273 deleted from function.json-decode by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215438@lists.php.net to get a copy of this message | ||
Note Submitter: majca J
----
Noted in a comment below is that this function will return NULL when given a simple string.
This is new behavior - see the result in PHP 5.2.4 :
php > var_dump(json_decode('this is a simple string'));
string(23) "this is a simple string"
in PHP 5.3.2 :
php > var_dump(json_decode('this is a simple string'));
NULL
I had several functions that relied on checking the value of a purported JSON string if it
didn't decode into an object/array. If you do too, be sure to be aware of this when upgrading
to PHP 5.3.