3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $time = new DateTime('Europe/Kiev'); echo $time->format('c'); $timestamp = $time->setTimezone(new DateTimezone('UTC'))->format('U'); echo $timestamp; echo (new DateTime($timestamp, 'Europe/Kiev'))->format('c'); echo (new DateTime($timestamp, 'Europe/Moskow'))->format('c');
Output for 7.0.20 - 7.2.6
2016-03-11T14:38:07+02:001457699887 Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, string given in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699887', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 7.0.6
2016-05-21T18:06:46+03:001463843206 Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, string given in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1463843206', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 7.0.5
2016-04-14T15:33:29+03:001460637209 Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, string given in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1460637209', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 7.0.4
2016-03-11T14:38:08+02:001457699888 Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, string given in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699888', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 7.0.1 - 7.0.3
2016-03-11T14:38:09+02:001457699889 Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, string given in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699889', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 7.0.0
2016-03-11T14:38:10+02:001457699890 Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, string given in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699890', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.6.28
2016-03-11T14:38:07+02:001457699887 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699887', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.6.21
2016-05-02T20:32:06+03:001462210326 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1462210326', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.6.20
2016-04-10T12:35:55+03:001460280955 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1460280955', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.33, 5.6.19
2016-03-11T14:38:08+02:001457699888 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699888', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.31 - 5.5.32, 5.6.17 - 5.6.18
2016-03-11T14:38:09+02:001457699889 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699889', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.29 - 5.5.30, 5.6.13 - 5.6.16
2016-03-11T14:38:10+02:001457699890 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699890', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.27 - 5.5.28, 5.6.11 - 5.6.12
2016-03-11T14:38:11+02:001457699891 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699891', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.24 - 5.5.26, 5.6.8 - 5.6.10
2016-03-11T14:38:12+02:001457699892 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699892', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.18 - 5.5.23, 5.6.3 - 5.6.7
2016-03-11T14:38:13+02:001457699893 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699893', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.9 - 5.5.16, 5.6.0 - 5.6.2
2016-03-11T14:38:14+02:001457699894 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699894', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.35
2016-05-23T08:47:33+03:001463982453 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1463982453', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.34
2016-04-11T14:49:37+03:001460375377 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1460375377', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.
Output for 5.5.0 - 5.5.8
2016-03-11T14:38:15+02:001457699895 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, string given' in /in/gr40n:10 Stack trace: #0 /in/gr40n(10): DateTime->__construct('1457699895', 'Europe/Kiev') #1 {main} thrown in /in/gr40n on line 10
Process exited with code 255.