3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Europe/London'); $dts = array(); $dts[] = new DateTime('2013-07-09 10:01:02 America/New_York'); $dts[] = new DateTime('10:01:02'); $dts[] = new DateTime('10:01:02 America/New_York'); $dts[] = new DateTime('10:01:02 Australia/Sydney'); foreach ( $dts as $dt ) echo $dt->format('c - e').PHP_EOL;
Output for 5.6.28, 7.0.12 - 7.1.0
2013-07-09T10:01:02-04:00 - America/New_York 2013-07-09T10:01:02+01:00 - Europe/London 2013-07-09T10:01:02-04:00 - America/New_York 2013-07-09T10:01:02+10:00 - Australia/Sydney
Output for 7.0.6
2013-07-09T10:01:02-04:00 - America/New_York 2016-05-03T10:01:02+01:00 - Europe/London 2016-05-03T10:01:02-04:00 - America/New_York 2016-05-03T10:01:02+10:00 - Australia/Sydney
Output for 7.0.5
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-03T10:01:02+01:00 - Europe/London 2016-04-02T10:01:02-04:00 - America/New_York 2016-04-03T10:01:02+10:00 - Australia/Sydney
Output for 7.0.4
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-10T10:01:02+00:00 - Europe/London 2016-03-10T10:01:02-05:00 - America/New_York 2016-03-11T10:01:02+11:00 - Australia/Sydney
Output for 7.0.3
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-18T10:01:02+00:00 - Europe/London 2016-03-18T10:01:02-04:00 - America/New_York 2016-03-19T10:01:02+11:00 - Australia/Sydney
Output for 7.0.2
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-22T10:01:02+00:00 - Europe/London 2016-03-22T10:01:02-04:00 - America/New_York 2016-03-23T10:01:02+11:00 - Australia/Sydney
Output for 7.0.1
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-24T10:01:02+00:00 - Europe/London 2016-03-23T10:01:02-04:00 - America/New_York 2016-03-24T10:01:02+11:00 - Australia/Sydney
Output for 7.0.0
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-27T10:01:02+01:00 - Europe/London 2016-03-26T10:01:02-04:00 - America/New_York 2016-03-27T10:01:02+11:00 - Australia/Sydney
Output for hhvm-3.12.0
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-12T10:01:02+00:00 - Europe/London 2016-03-12T10:01:02-05:00 - America/New_York 2016-03-12T10:01:02+11:00 - Australia/Sydney
Output for hhvm-3.10.0
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-30T10:01:02+01:00 - Europe/London 2016-03-30T10:01:02-04:00 - America/New_York 2016-03-30T10:01:02+11:00 - Australia/Sydney
Output for 5.6.21
2013-07-09T10:01:02-04:00 - America/New_York 2016-05-02T10:01:02+01:00 - Europe/London 2016-05-02T10:01:02-04:00 - America/New_York 2016-05-02T10:01:02+10:00 - Australia/Sydney
Output for 5.6.20
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-10T10:01:02+01:00 - Europe/London 2016-04-09T10:01:02-04:00 - America/New_York 2016-04-10T10:01:02+10:00 - Australia/Sydney
Output for 5.6.19
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-07T10:01:02+00:00 - Europe/London 2016-03-07T10:01:02-05:00 - America/New_York 2016-03-08T10:01:02+11:00 - Australia/Sydney
Output for 5.6.18
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-15T10:01:02+00:00 - Europe/London 2016-03-15T10:01:02-04:00 - America/New_York 2016-03-15T10:01:02+11:00 - Australia/Sydney
Output for 5.6.17
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-19T10:01:02+00:00 - Europe/London 2016-03-19T10:01:02-04:00 - America/New_York 2016-03-20T10:01:02+11:00 - Australia/Sydney
Output for 5.6.16
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-28T10:01:02+01:00 - Europe/London 2016-03-27T10:01:02-04:00 - America/New_York 2016-03-28T10:01:02+11:00 - Australia/Sydney
Output for 5.6.15
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-29T10:01:02+01:00 - Europe/London 2016-03-28T10:01:02-04:00 - America/New_York 2016-03-29T10:01:02+11:00 - Australia/Sydney
Output for 5.6.14
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-02T10:01:02+01:00 - Europe/London 2016-04-02T10:01:02-04:00 - America/New_York 2016-04-02T10:01:02+11:00 - Australia/Sydney
Output for 5.6.13
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-15T10:01:02+01:00 - Europe/London 2016-04-15T10:01:02-04:00 - America/New_York 2016-04-15T10:01:02+10:00 - Australia/Sydney
Output for 5.6.12
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-20T10:01:02+01:00 - Europe/London 2016-04-19T10:01:02-04:00 - America/New_York 2016-04-20T10:01:02+10:00 - Australia/Sydney
Output for 5.6.11
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-23T10:01:02+01:00 - Europe/London 2016-04-23T10:01:02-04:00 - America/New_York 2016-04-23T10:01:02+10:00 - Australia/Sydney
Output for 5.6.10
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-25T10:01:02+01:00 - Europe/London 2016-04-25T10:01:02-04:00 - America/New_York 2016-04-25T10:01:02+10:00 - Australia/Sydney
Output for 5.6.9
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-27T10:01:02+01:00 - Europe/London 2016-04-27T10:01:02-04:00 - America/New_York 2016-04-27T10:01:02+10:00 - Australia/Sydney
Output for 5.6.8
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-29T10:01:02+01:00 - Europe/London 2016-04-29T10:01:02-04:00 - America/New_York 2016-04-30T10:01:02+10:00 - Australia/Sydney
Output for 5.5.35
2013-07-09T10:01:02-04:00 - America/New_York 2016-05-22T10:01:02+01:00 - Europe/London 2016-05-22T10:01:02-04:00 - America/New_York 2016-05-22T10:01:02+10:00 - Australia/Sydney
Output for 5.5.34
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-11T10:01:02+01:00 - Europe/London 2016-04-10T10:01:02-04:00 - America/New_York 2016-04-11T10:01:02+10:00 - Australia/Sydney
Output for 5.5.33
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-09T10:01:02+00:00 - Europe/London 2016-03-08T10:01:02-05:00 - America/New_York 2016-03-09T10:01:02+11:00 - Australia/Sydney
Output for 5.5.32
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-17T10:01:02+00:00 - Europe/London 2016-03-17T10:01:02-04:00 - America/New_York 2016-03-17T10:01:02+11:00 - Australia/Sydney
Output for 5.5.31
2013-07-09T10:01:02-04:00 - America/New_York 2016-03-20T10:01:02+00:00 - Europe/London 2016-03-20T10:01:02-04:00 - America/New_York 2016-03-21T10:01:02+11:00 - Australia/Sydney
Output for 5.5.30
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-01T10:01:02+01:00 - Europe/London 2016-04-01T10:01:02-04:00 - America/New_York 2016-04-01T10:01:02+11:00 - Australia/Sydney
Output for 5.5.29
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-17T10:01:02+01:00 - Europe/London 2016-04-16T10:01:02-04:00 - America/New_York 2016-04-17T10:01:02+10:00 - Australia/Sydney
Output for 5.5.28
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-21T10:01:02+01:00 - Europe/London 2016-04-20T10:01:02-04:00 - America/New_York 2016-04-21T10:01:02+10:00 - Australia/Sydney
Output for 5.5.27
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-22T10:01:02+01:00 - Europe/London 2016-04-22T10:01:02-04:00 - America/New_York 2016-04-22T10:01:02+10:00 - Australia/Sydney
Output for 5.5.26
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-26T10:01:02+01:00 - Europe/London 2016-04-26T10:01:02-04:00 - America/New_York 2016-04-26T10:01:02+10:00 - Australia/Sydney
Output for 5.5.25
2013-07-09T10:01:02-04:00 - America/New_York 2016-04-28T10:01:02+01:00 - Europe/London 2016-04-28T10:01:02-04:00 - America/New_York 2016-04-29T10:01:02+10:00 - Australia/Sydney
Output for 5.5.24
2013-07-09T10:01:02-04:00 - America/New_York 2016-05-24T10:01:02+01:00 - Europe/London 2016-05-23T10:01:02-04:00 - America/New_York 2016-05-24T10:01:02+10:00 - Australia/Sydney
Output for 5.2.0 - 5.4.45
2013-07-09T10:01:02-04:00 - America/New_York 2016-02-18T10:01:02+00:00 - Europe/London 2016-02-18T10:01:02-05:00 - America/New_York 2016-02-19T10:01:02+11:00 - Australia/Sydney
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/0oEqh on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/0oEqh on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/0oEqh on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/0oEqh on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/0oEqh on line 2