php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72074 IntlDateFormatter not working for all of the identifiers
Submitted: 2016-04-22 08:33 UTC Modified: 2016-05-15 04:22 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:4 of 5 (80.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: gjorgjioski at gmail dot com Assigned:
Status: No Feedback Package: intl (PECL)
PHP Version: 5.6.20 OS: Linux CentOS
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gjorgjioski at gmail dot com
New email:
PHP Version: OS:

 

 [2016-04-22 08:33 UTC] gjorgjioski at gmail dot com
Description:
------------
When using new IntlDateFormatter sometimes no object is created. On our production server, for the following timezones, IntlDateFormatter cannot be created: 

Africa/Juba
America/Bahia_Banderas
America/Creston
America/Fort_Nelson
America/Kralendijk
America/Lower_Princes
America/Matamoros
America/Metlakatla
America/North_Dakota/Beulah
America/Ojinaga
America/Sitka
Antarctica/Macquarie
Antarctica/Troll
Asia/Barnaul
Asia/Chita
Asia/Hebron
Asia/Khandyga
Asia/Novokuznetsk
Asia/Srednekolymsk
Asia/Ust-Nera
Europe/Astrakhan
Europe/Busingen
Europe/Ulyanovsk
Pacific/Bougainville
Pacific/Chuuk
Pacific/Pohnpei

On the other side, this list is a bit different on our development server, and 
here it is: 

America/Fort_Nelson
Antarctica/Troll
Asia/Barnaul
Asia/Chita
Asia/Khandyga
Asia/Srednekolymsk
Asia/Ust-Nera
Europe/Astrakhan
Europe/Busingen
Europe/Ulyanovsk
Pacific/Bougainville

It is the same version of php, 5.6.18. OS is CentOS, on production v 6.7, and on development v 7.0. If you need additional info to debug this situation, please let me know and I will be happy to provide. 



Test script:
---------------
$tz_identifiers = DateTimeZone::listIdentifiers();
foreach ($tz_identifiers as $tz_identifier){
$test = new IntlDateFormatter(
    'en_US',
    IntlDateFormatter::FULL,
    IntlDateFormatter::SHORT,
    $tz_identifier
);
        if (empty($test)){
                print($tz_identifier);
        }
}


Expected result:
----------------
I expect to see no output from the above script, IntlDateFormatter should be created for every timezone listed. 

Actual result:
--------------
Timezones that IntlDateFormatter can not be created for. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-02 09:46 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-05-02 09:46 UTC] ab@php.net
Thanks for the report. From what I read, it is not a PHP issue. Furthermore - I don't reproduce this with fe ICU 57.1. Please try to link with the latest ICU.

Thanks.
 [2016-05-15 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2016-05-16 11:49 UTC] gjorgjioski at gmail dot com
After upgrading both servers to icu 57_1 everything works as it should. Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 02:03:34 2021 UTC