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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Mar 19 09:01:30 2024 UTC