|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66027 json_encode returns 'null' string instead of false on error
Submitted: 2013-11-03 16:31 UTC Modified: 2013-11-03 17:19 UTC
From: vseticka dot martin at gmail dot com Assigned: nikic (profile)
Status: Closed Package: JSON related
PHP Version: 5.4.21 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vseticka dot martin at gmail dot com
New email:
PHP Version: OS:


 [2013-11-03 16:31 UTC] vseticka dot martin at gmail dot com
The script shows that json_encode function does not return FALSE on JSON_ERROR_UTF8 error as stated in manual page but it returns "null" string.

Test script:
$result = json_encode(iconv('UTF-8', 'UCS-2', "Příliš žluťoučký kůň úpěl ďábelské ódy."));

Expected result:

Actual result:
string(4) "null"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-03 17:19 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2013-11-03 17:19 UTC]
Has already been fixed in 5.5
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 20 20:03:44 2023 UTC