php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66852 Error in json_decode function
Submitted: 2014-03-08 00:34 UTC Modified: 2014-03-08 00:55 UTC
From: php at zeflo dot com Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at zeflo dot com
New email:
PHP Version: OS:

 

 [2014-03-08 00:34 UTC] php at zeflo dot com
Description:
------------
I discovered tha jason_decode can't decode 0e+1. Is this a Bug or a Feature?

Test script:
---------------
Works:

print_r(json_decode('{"var":0.e+1}'));
print_r(json_decode('{"var":0.e-1}'));
print_r(json_decode('{"var":0.0e+1}'));
print_r(json_decode('{"var":0.0e-1}'));

Will not Work:

print_r(json_decode('{"var":0e+1}'));
print_r(json_decode('{"var":0e-1}'));

Expected result:
----------------
Every line should return:

stdClass Object ( [var] => 0 )

Actual result:
--------------
The last two lines return nothing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-08 00:55 UTC] php at zeflo dot com
-Status: Open +Status: Closed
 [2014-03-08 00:55 UTC] php at zeflo dot com
I used 5.2.12. I see that in new versions this bug is already closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 00:01:33 2024 UTC