|  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
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
 [2015-11-02 16:30 UTC] serhiy dot shkolyarenko at gmail dot com
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'));


Add a Patch

Pull Requests

Add a Pull Request


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]
-Assigned To: +Assigned To: derick
 [2015-11-03 11:10 UTC]
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.

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


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

[1] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jan 18 02:01:23 2021 UTC