Skip to content

timezone_identifiers_list(DateTimeZone::ALL_WITH_BC) Invalid timezones #18741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
blaaat opened this issue Jun 2, 2025 · 0 comments
Open

timezone_identifiers_list(DateTimeZone::ALL_WITH_BC) Invalid timezones #18741

blaaat opened this issue Jun 2, 2025 · 0 comments

Comments

@blaaat
Copy link

blaaat commented Jun 2, 2025

Description

The following code:

<?php
foreach (timezone_identifiers_list(DateTimeZone::ALL_WITH_BC) as $zone) {
        $timezone = new DateTimeZone($zone);
}

Resulted in this output:

PHP Fatal error:  Uncaught DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (leapseconds) in /root/a.php:3
Stack trace:
#0 /root/a.php(3): DateTimeZone->__construct('leapseconds')

But I expected this output instead:

no error

my timezone_identifiers_list(DateTimeZone::ALL_WITH_BC) includes invalid timezones:

  • leapseconds
  • tzdata.zi

On a Rocky9 installation with php installation from remi repo: 8.3.21-1.el9.remi

PHP Version

PHP 8.3.21 (cli) (built: May  6 2025 13:58:10) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.3.21, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.21, Copyright (c), by Zend Technologies

Operating System

Rocky Linux release 9.5 (Blue Onyx)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant