php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70838 DateTimeZone::listIdentifiers() ignores parameter $country
Submitted: 2015-11-02 16:30 UTC Modified: 2020-12-09 17:57 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: serhiy dot shkolyarenko at gmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.6.15 OS: any
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: serhiy dot shkolyarenko at gmail dot com
New email:
PHP Version: OS:

 

 [2015-11-02 16:30 UTC] serhiy dot shkolyarenko at gmail dot com
Description:
------------
DateTimeZone::listIdentifiers() ignores second parameter.
Attached script shows cities for the whole Europe, but not for Ukraine only.
Checked for PHP versions 5.6.11 and 7.0.0-RC6.


Test script:
---------------
var_dump(DateTimeZone::listIdentifiers(DateTimeZone::EUROPE, 'UA'));


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-03 09:32 UTC] serhiy dot shkolyarenko at gmail dot com
-Status: Open +Status: Closed
 [2015-11-03 09:32 UTC] serhiy dot shkolyarenko at gmail dot com
Closed, NOT A BUG
DateTimeZone::PER_COUNTRY should be used
 [2015-11-03 11:10 UTC] derick@php.net
-Assigned To: +Assigned To: derick
 [2015-11-03 11:10 UTC] derick@php.net
If you have a suggestion on how to make this clearer in the docs, feel free to mention it! Or, perhaps we should raise a warning if you specify two args and not use "PER_COUNTRY"?
 [2015-11-04 16:27 UTC] serhiy dot shkolyarenko at gmail dot com
I think, updating documentation is enough.

country
    A two-letter ISO 3166-1 compatible country code. Applicable when _what_ argument is  DateTimeZone::PER_COUNTRY only.


Example:

//Show all timezones for US.
DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, 'US');
 [2015-11-05 16:40 UTC] derick@php.net
-Status: Closed +Status: Re-Opened -Package: Date/time related +Package: Documentation problem
 [2017-01-28 13:00 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: Date/time related
 [2017-10-24 05:25 UTC] kalle@php.net
-Status: Re-Opened +Status: Assigned
 [2020-12-09 17:57 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2020-12-09 17:57 UTC] cmb@php.net
This has already been fixed in 2009[1].

[1] <http://svn.php.net/viewvc?view=revision&revision=282530>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 05:01:28 2025 UTC