php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41403 json_decode cannot decode floats if localeconv decimal_point is not '.'
Submitted: 2007-05-15 17:44 UTC Modified: 2007-05-16 12:54 UTC
From: rainer dot collet at gmx dot net Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 5.2.2 OS: debian etch
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: rainer dot collet at gmx dot net
New email:
PHP Version: OS:

 

 [2007-05-15 17:44 UTC] rainer dot collet at gmx dot net
Description:
------------
if you set locale to for example de_DE json_decode will not decode floats correctly anymore.

Reproduce code:
---------------
setlocale(LC_NUMERIC, 'de_DE');
var_dump(json_decode('[2.1]');

Expected result:
----------------
array(1) { [0]=>  float(2.1) }

Actual result:
--------------
array(1) { [0]=>  float(2) }

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-16 12:54 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC