|  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
if you set locale to for example de_DE json_decode will not decode floats correctly anymore.

Reproduce code:
setlocale(LC_NUMERIC, 'de_DE');

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

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-16 12:54 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 15:05:48 2023 UTC