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 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.
(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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 16 05:01:29 2024 UTC