|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40360 current locale affects how json_encode encodes floats
Submitted: 2007-02-05 02:09 UTC Modified: 2007-02-05 03:16 UTC
From: ftl_ at freemail dot hu Assigned:
Status: Closed Package: Variables related
PHP Version: 5.2.0 OS: Gentoo Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ftl_ at freemail dot hu
New email:
PHP Version: OS:


 [2007-02-05 02:09 UTC] ftl_ at freemail dot hu
json_encode is using the decimal separator of the current locale instead of using "."
(similar to

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

Expected result:
string(3) "1.2"
string(3) "1.2"

Actual result:
string(3) "1.2"
string(3) "1,2"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-05 03:16 UTC] ftl_ at freemail dot hu
fixed in PHP 5.2.1RC5-dev (cli) (built: Feb  5 2007 00:22:58)
(sorry for this thoughtless bugreport.)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 24 15:01:23 2021 UTC