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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 14:01:37 2025 UTC