You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DateTimeZone fails to parse time zones that contain the "+" character #10218
Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/GMT+1) in /in/bGhje:3
Stack trace:
#0 /in/bGhje(3): DateTimeZone->__construct('Etc/GMT+1')
#1 {main}
thrown in /in/bGhje on line 3
Looks like it broke after the latest timelib update. Looking through the recent changes, it seems that the + character is not considered in this lookup function.
Can confirm this issue affects >= 8.1.14 and is not present in versions bellow.
Running code from first example:
Docker - 8.1.13
/app/test.php:2:
class DateTime#1 (3) {
public $date =>
string(26) "2023-01-10 08:15:09.977455"
public $timezone_type =>
int(3)
public $timezone =>
string(9) "Etc/GMT+1"
}
Docker - 8.1.14
Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/GMT+1) in /app/test.php:2
Stack trace:
#0 /app/test.php(2): DateTimeZone->__construct('Etc/GMT+1')
#1 {main}
thrown in /app/test.php on line 2
Activity
heiglandreas commentedon Jan 4, 2023
As per https://www.php.net/manual/en/timezones.others.php this can be expected behaviour as you should not use those! Depending on the implemented timezone-db this can break.
cmb69 commentedon Jan 4, 2023
This behavioral change has likely been introduced by fixing #9700.
hormus commentedon Jan 5, 2023
i'm in favor of reverting to previous code, user side it's easy to interpret even if you use convert it's good for 3rd party code
kalenjohnson commentedon Jan 6, 2023
Looks like this also affects 8.1.14
xZero707 commentedon Jan 10, 2023
Can confirm this issue affects >= 8.1.14 and is not present in versions bellow.
Running code from first example:
Docker - 8.1.13
Docker - 8.1.14
Fixed GH-10218: DateTimeZone fails to parse time zones that contain t…
DEV-65163 mark tests as skipped due to php src error, see php/php-src…
DEV-65163 mark tests as skipped due to php src error, see php/php-src…