[php-src] Issue #10285: DateTimeZone Doesn't Handle Etc/GMT+10 in Php8.1.14 and Php8.2.1

From: Date: Wed, 11 Jan 2023 03:29:12 +0000
Subject: [php-src] Issue #10285: DateTimeZone Doesn't Handle Etc/GMT+10 in Php8.1.14 and Php8.2.1
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-243399@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10285
Author: oleibman

### Description

The following code:

```php
<?php
new DateTimeZone('Etc/GMT+10');
```

Resulted in this output:
```
Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/GMT+10)
in C:\Users\OwenLeibman\Downloads\php-8.1.14-Win32-vs16-x64\tzbug.php:2
Stack trace:
#0 C:\Users\OwenLeibman\Downloads\php-8.1.14-Win32-vs16-x64\tzbug.php(2):
DateTimeZone->__construct('Etc/GMT+10')
#1 {main}
  thrown in C:\Users\OwenLeibman\Downloads\php-8.1.14-Win32-vs16-x64\tzbug.php on line 2
```

But I expected no output instead:
```
```
This error is introduced in Php8.1.14 and 8.2.1 (and 8.3 nightlies). It was not present in 8.1.13 or
8.2.0. It appears that all timezones of the form Etc/GMT+whatever fail; Etc/GMT-whatever continues
to work. Etc/GMT+whatever continues to be listed as a supported timezone at https://www.php.net/manual/en/timezones.others.php



### PHP Version

Php 8.2.1 and Php 8.1.14

### Operating System

Windows


Thread (1 message)

  • oleibman
« previous php.bugs (#243399) next »