note 98273 added to function.json-decode

From: Date: Sun, 06 Jun 2010 00:42:08 +0000
Subject: note 98273 added to function.json-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-169911@lists.php.net to get a copy of this message
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. ---- Server IP: 69.147.83.197 Probable Submitter: 71.10.72.253 ---- Manual Page -- http://www.php.net/manual/en/function.json-decode.php Edit -- https://master.php.net/note/edit/98273 Del: integrated -- https://master.php.net/note/delete/98273/integrated Del: useless -- https://master.php.net/note/delete/98273/useless Del: bad code -- https://master.php.net/note/delete/98273/bad+code Del: spam -- https://master.php.net/note/delete/98273/spam Del: non-english -- https://master.php.net/note/delete/98273/non-english Del: in docs -- https://master.php.net/note/delete/98273/in+docs Del: other reasons-- https://master.php.net/note/delete/98273 Reject -- https://master.php.net/note/reject/98273 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169911) next »