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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 15:01:31 2025 UTC