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: 2017-10-24 05:25 UTC
From: serhiy dot shkolyarenko at gmail dot com Assigned: derick (profile)
Status: Assigned Package: Date/time related
PHP Version: 5.6.15 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC