#43774 [Opn->Fbk]: json_decode cause notices when called with non json data
| From: | iliaa@php.net | Date: | Mon, 07 Jan 2008 14:56:10 +0000 |
| Subject: | #43774 [Opn->Fbk]: json_decode cause notices when called with non json data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121104@lists.php.net to get a copy of this message | ||
ID: 43774
Updated by: iliaa@php.net
Reported By: marcin dot krzyzanowski at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: JSON related
Operating System: Windows
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2008-01-06 23:34:10] marcin dot krzyzanowski at gmail dot com
Description:
------------
I think that json_decode have problem with incorrect data passed as
parameter;
Reproduce code:
---------------
$post = " ";
$data = json_decode($post);
some other code here
Expected result:
----------------
empty $data or similar
Actual result:
--------------
for every line of code below (even if it's commented out) will show
Notice: Trying to get property of non-object in file.php on line 54
Notice: Trying to get property of non-object in file.php on line 55
etc..
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43774&edit=1