3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $timezones = [ 'Pacific/Auckland', 'Australia/Canberra', 'Asia/Mumbai', 'Asia/Istanbul', 'Europe/Paris', 'Europe/London', 'America/Sao_Paulo', 'America/New_York', 'America/Los_Angeles' ]; $date = new DateTime('2015-11-05 03:59:59 UTC'); foreach ($timezones as $timezone) { $date->setTimezone(new DateTimeZone($timezone)); echo sprintf('%-20s%s', $timezone.':', $date->format('Y-m-d H:i:s'))."\n"; }
based on am9KL
Output for 7.0.0 - 7.2.0
Pacific/Auckland: 2015-11-05 16:59:59 Australia/Canberra: 2015-11-05 14:59:59 Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Asia/Mumbai) in /in/Nbj4I:16 Stack trace: #0 /in/Nbj4I(16): DateTimeZone->__construct('Asia/Mumbai') #1 {main} thrown in /in/Nbj4I on line 16
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Pacific/Auckland: 2015-11-05 16:59:59 Australia/Canberra: 2015-11-05 14:59:59 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (Asia/Mumbai)' in /in/Nbj4I:16 Stack trace: #0 /in/Nbj4I(16): DateTimeZone->__construct('Asia/Mumbai') #1 {main} thrown in /in/Nbj4I on line 16
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Nbj4I on line 2
Process exited with code 255.