|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72574 Non encoded string with IP-address recognized as float by json_decode
Submitted: 2016-07-11 09:27 UTC Modified: 2016-07-12 09:33 UTC
From: apuzanoff at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: JSON related
PHP Version: 5.6.23 OS: deb8u1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 - 43 = ?
Subscribe to this entry?

 [2016-07-11 09:27 UTC] apuzanoff at gmail dot com
From manual page:

non encoded string with IP-address recognized as float

Test script:
echo json_decode(''), '<br>';

Expected result:
empty string with generate error

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-11 09:31 UTC] apuzanoff at gmail dot com
P.S. It works on windows php as expected. Empty string and JSON_ERROR_SYNTAX from json_last_error()
 [2016-07-11 12:05 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-07-11 12:05 UTC]
I can't reproduce with ext/json, see <>.
However, Debian ships with json-c by default; which libjson do you
 [2016-07-12 05:43 UTC] apuzanoff at gmail dot com
-Status: Feedback +Status: Assigned
 [2016-07-12 05:43 UTC] apuzanoff at gmail dot com
json support => enabled
json version => 1.3.6
JSON-C headers version => 0.11.99
JSON-C library version => 0.11.99
 [2016-07-12 09:27 UTC]
-Status: Assigned +Status: Not a bug
 [2016-07-12 09:27 UTC]
JSON-C is an external JSON extension which we do not maintain. From a quick look at the pecl-json-c repo, the issue is already fixed there: Maybe you can convince Debian to update their version.
 [2016-07-12 09:33 UTC]

I have filed a respective ticket in the json-c tracker
(<>), and close
this report.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Feb 28 11:01:24 2021 UTC