3v4l.org

run code in 500+ PHP versions simultaneously
<?php var_dump(date_default_timezone_set('Etc/GMT+9')); $d = new DateTime(); var_dump($d->getTimeZone()); new DateTimeZone('Etc/GMT+9');
Output for 8.1.14, 8.2.1
bool(true) object(DateTimeZone)#2 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+9" } Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/GMT+9) in /in/lfalF:9 Stack trace: #0 /in/lfalF(9): DateTimeZone->__construct('Etc/GMT+9') #1 {main} thrown in /in/lfalF on line 9
Process exited with code 255.
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.13, 8.1.15 - 8.1.34, 8.2.0, 8.2.2 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
bool(true) object(DateTimeZone)#2 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+9" }

preferences:
37.99 ms | 1150 KiB | 13 Q