3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(new DateTimeZone('UTC')); var_dump(new DateTimeZone('+00')); var_dump(new DateTimeZone('+00:00')); var_dump(new DateTimeZone('+00:00:00')); var_dump(new DateTimeZone('+0000')); var_dump(new DateTimeZone('0000'));
Output for 8.3.0 - 8.3.4, 8.3.6
object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (0000) in /in/DPRae:8 Stack trace: #0 /in/DPRae(8): DateTimeZone->__construct('0000') #1 {main} thrown in /in/DPRae on line 8
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (0000) in /in/DPRae:8 Stack trace: #0 /in/DPRae(8): DateTimeZone->__construct('0000') #1 {main} thrown in /in/DPRae on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.9, 8.1.7 - 8.1.27, 8.2.0 - 8.2.18
object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (0000) in /in/DPRae:8 Stack trace: #0 /in/DPRae(8): DateTimeZone->__construct('0000') #1 {main} thrown in /in/DPRae on line 8
Process exited with code 255.
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.6
object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (+00:00:00) in /in/DPRae:6 Stack trace: #0 /in/DPRae(6): DateTimeZone->__construct('+00:00:00') #1 {main} thrown in /in/DPRae on line 6
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeZone)#1 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (0000)' in /in/DPRae:8 Stack trace: #0 /in/DPRae(8): DateTimeZone->__construct('0000') #1 {main} thrown in /in/DPRae on line 8
Process exited with code 255.

preferences:
152.48 ms | 402 KiB | 182 Q