3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(new \DateTime('now', new \DateTimeZone('Europe/London')));
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-08-07 11:33:09.003839" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.28, 7.0.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-08-07 11:33:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-03 08:42:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-02 21:34:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-10 08:07:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-18 08:44:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-22 14:38:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-23 19:23:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-26 20:56:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for hhvm-3.12.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 21:10:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for hhvm-3.10.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-30 10:12:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 04:04:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-09 20:31:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-07 16:15:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 00:09:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-19 12:59:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 22:41:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 23:46:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-02 02:07:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-15 06:01:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-19 19:46:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-23 02:50:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 04:33:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 09:32:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-29 17:36:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-22 07:47:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 22:51:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-08 19:12:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 01:52:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-20 15:45:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 01:42:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-16 20:07:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 22:51:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 01:21:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 07:00:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-28 13:18:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-23 20:39:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:12:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.44
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:12:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:11:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.42
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:11:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.41
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:11:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:11:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-21 11:11:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.38
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-03-05 15:55:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.35 - 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-03-05 15:55:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-03-05 15:55:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-08-28 10:22:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.30 - 5.4.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-08-07 11:33:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.4.12 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-08-07 11:33:14" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.3.20 - 5.3.28, 5.4.0 - 5.4.11
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-08-07 11:33:15" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-08-28 10:22:40" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.3.0 - 5.3.19
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-08-07 11:33:16" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" }
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Fatal error: Class 'DateTime' not found in /in/RICPm on line 1
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Fatal error: Cannot instantiate non-existent class: datetime in /in/RICPm on line 1
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RICPm on line 1 Fatal error: Cannot instantiate non-existent class: datetime in /in/RICPm on line 1