php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68636 setlocale no longer returns current value per category.
Submitted: 2014-12-23 10:51 UTC Modified: 2015-01-07 22:44 UTC
From: arjen at react dot com Assigned: dmitry (profile)
Status: Closed Package: Strings related
PHP Version: master-Git-2014-12-23 (Git) OS: 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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: arjen at react dot com
New email:
PHP Version: OS:

 

 [2014-12-23 10:51 UTC] arjen at react dot com
Description:
------------
setlocale used to return current locale per category when passing null or "0" as locale, but now it's returning the latest set locale.

The actual value for LC_TIME is still 'en_US.UTF8', it's only reporting the wrong value.

Regression since https://github.com/php/php-src/commit/4514ba016ff158cd113deef1a215fcdcb6913b48

Test script:
---------------
var_dump(setlocale(LC_TIME, 'en_US.UTF8'));
var_dump(setlocale(LC_NUMERIC, 'C'));
var_dump(setlocale(LC_TIME, 0));

Expected result:
----------------
string(10) "en_US.UTF8"
string(1) "C"
string(10) "en_US.UTF8"

Actual result:
--------------
string(10) "en_US.UTF8"
string(1) "C"
string(1) "C"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-07 22:44 UTC] danack@php.net
-Assigned To: +Assigned To: dmitry
 [2015-01-07 22:44 UTC] danack@php.net
Hi,

The commit was from Dmitry, so assigning it to him.
 [2015-01-08 22:42 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7b4808a6471655b44e65cfb4585c01f2efea444a
Log: Fixed bug #68636 (setlocale no longer returns current value per category).
 [2015-01-08 22:42 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7b4808a6471655b44e65cfb4585c01f2efea444a
Log: Fixed bug #68636 (setlocale no longer returns current value per category).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC