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
 [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: Sun Dec 01 21:01:32 2024 UTC