3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.2.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 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 5.5.24 - 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.
Output for 5.3.20 - 5.4.45
object(DateTimeZone)#1 (0) { } Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (+00)' in /in/DPRae:4 Stack trace: #0 /in/DPRae(4): DateTimeZone->__construct('+00') #1 {main} thrown in /in/DPRae on line 4
Process exited with code 255.