|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
29 + 15 = ?
Subscribe to this entry?

 [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-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 13:03:37 2021 UTC