|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69690 IntlDateFormatter returns null for some timezones
Submitted: 2015-05-22 08:56 UTC Modified: 2015-05-31 04:22 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: forsoap at gmail dot com Assigned:
Status: No Feedback Package: intl (PECL)
PHP Version: 5.6.9 OS: Fedora 21
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:
Bug Type:
From: forsoap at gmail dot com
New email:
PHP Version: OS:


 [2015-05-22 08:56 UTC] forsoap at gmail dot com
For some timezones IntlDateFormatter returns null instead of instance.

Test script:
foreach (\DateTimeZone::listIdentifiers() as $timezone) {
    $formatter = new \IntlDateFormatter(
    if (null === $formatter) {
        echo $timezone . PHP_EOL;

Expected result:
Output is empty

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-22 14:28 UTC]
-Status: Open +Status: Feedback
 [2015-05-22 14:28 UTC]

The issue of the IntlDateFormatter returning null will be fixed with the release of PHP 7; the behaviour was deliberate before, but was changed by an RFC

Just to note, your code example below will now throw an IntlException where it was before returning null from the constructor. The root cause of it failing to make the IntlDateFormatter is, I presume, that the Intl library is not aware of those timezones, as that library gets its data from a different location than the DateTime library.

If you think PHP should be aware of those timezones, please can you check that the ICU library on your system is aware for them?

 [2015-05-31 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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 09:01:28 2024 UTC