#38440 [Opn->Bgs]: json_decode() on boolean strings returns NULL

From: Date: Sun, 13 Aug 2006 08:47:17 +0000
Subject: #38440 [Opn->Bgs]: json_decode() on boolean strings returns NULL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100727@lists.php.net to get a copy of this message
ID: 38440 User updated by: clay at killersoft dot com Reported By: clay at killersoft dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Mac OS X 10.4.7 PHP Version: 5.2.0RC1 New Comment: fail1.json of the JSON_checker test suite says: "A JSON payload should be an object or array, not a string." Sorry about the noise. Previous Comments: ------------------------------------------------------------------------ [2006-08-13 07:23:21] clay at killersoft dot com var_dump(json_decode('false')); Should return: bool(false); Actually returns: NULL ------------------------------------------------------------------------ [2006-08-13 07:05:06] clay at killersoft dot com Description: ------------ JSON decoder returns NULL when passed a string containing 'true'. Reproduce code: --------------- var_dump(json_decode('true')); Expected result: ---------------- bool(true) Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38440&edit=1

« previous php.bugs (#100727) next »