3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $now = new \DateTime(); print_r($now); $punchIn = new \DateTime(); // 10:55 am $punchIn->setTime(15,55);
Output for 7.1.0
DateTime Object ( [date] => 2013-05-23 14:07:47.006013 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.28, 7.0.12 - 7.0.14
DateTime Object ( [date] => 2013-05-23 14:07:47.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.6
DateTime Object ( [date] => 2016-05-03 03:22:56.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.5
DateTime Object ( [date] => 2016-04-02 16:36:23.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.4
DateTime Object ( [date] => 2016-03-10 02:14:55.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.3
DateTime Object ( [date] => 2016-03-18 02:27:14.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.2
DateTime Object ( [date] => 2016-03-21 13:00:14.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.1
DateTime Object ( [date] => 2016-03-23 13:13:42.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.0
DateTime Object ( [date] => 2016-03-26 15:37:18.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for hhvm-3.12.0
DateTime Object ( [date] => 2016-03-30 08:41:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for hhvm-3.10.0
DateTime Object ( [date] => 2016-03-29 21:36:02.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.21
DateTime Object ( [date] => 2016-05-01 22:25:50.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.20
DateTime Object ( [date] => 2016-04-09 11:49:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.19
DateTime Object ( [date] => 2016-03-07 00:47:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.18
DateTime Object ( [date] => 2016-03-14 12:52:42.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.17
DateTime Object ( [date] => 2016-03-19 06:55:49.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.16
DateTime Object ( [date] => 2016-03-27 17:22:40.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.15
DateTime Object ( [date] => 2016-03-28 18:15:19.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.14
DateTime Object ( [date] => 2016-04-01 20:51:14.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.13
DateTime Object ( [date] => 2016-04-15 00:48:27.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.12
DateTime Object ( [date] => 2016-04-19 13:52:40.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.11
DateTime Object ( [date] => 2016-04-22 21:09:36.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.10
DateTime Object ( [date] => 2016-04-24 22:47:42.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.9
DateTime Object ( [date] => 2016-04-27 03:59:28.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.8
DateTime Object ( [date] => 2016-04-29 11:42:46.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.35
DateTime Object ( [date] => 2016-05-22 01:50:03.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.34
DateTime Object ( [date] => 2016-04-10 17:46:31.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.33
DateTime Object ( [date] => 2016-03-08 13:06:54.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.32
DateTime Object ( [date] => 2016-03-16 18:49:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.31
DateTime Object ( [date] => 2016-03-20 09:47:48.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.30
DateTime Object ( [date] => 2016-03-31 20:16:54.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.29
DateTime Object ( [date] => 2016-04-16 14:49:09.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.28
DateTime Object ( [date] => 2016-04-20 17:10:37.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.27
DateTime Object ( [date] => 2016-04-21 19:38:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.26
DateTime Object ( [date] => 2016-04-26 01:16:45.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.25
DateTime Object ( [date] => 2016-04-28 07:17:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.24
DateTime Object ( [date] => 2016-04-30 14:42:35.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.45
DateTime Object ( [date] => 2016-02-20 23:52:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.42 - 5.4.44
DateTime Object ( [date] => 2016-02-20 23:52:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.40 - 5.4.41
DateTime Object ( [date] => 2016-02-20 23:52:06.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.37 - 5.4.39
DateTime Object ( [date] => 2016-02-20 23:52:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.34 - 5.4.36
DateTime Object ( [date] => 2016-02-20 23:52:08.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.31 - 5.4.32
DateTime Object ( [date] => 2016-02-20 23:52:09.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.30
DateTime Object ( [date] => 2016-02-20 23:52:10.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.28 - 5.4.29
DateTime Object ( [date] => 2016-02-20 23:52:10 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.24 - 5.4.27
DateTime Object ( [date] => 2016-02-20 23:52:11 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.28, 5.4.21 - 5.4.23
DateTime Object ( [date] => 2016-02-20 23:52:12 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.27, 5.4.18 - 5.4.20
DateTime Object ( [date] => 2016-02-20 23:52:13 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.25 - 5.3.26, 5.4.15 - 5.4.17
DateTime Object ( [date] => 2016-02-20 23:52:14 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.21 - 5.3.24, 5.4.11 - 5.4.14
DateTime Object ( [date] => 2016-02-20 23:52:15 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.17 - 5.3.20, 5.4.7 - 5.4.10
DateTime Object ( [date] => 2016-02-20 23:52:16 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.14 - 5.3.16, 5.4.3 - 5.4.6
DateTime Object ( [date] => 2016-02-20 23:52:17 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.10 - 5.3.13, 5.4.0 - 5.4.2
DateTime Object ( [date] => 2016-02-20 23:52:18 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.29
DateTime Object ( [date] => 2016-02-20 23:52:09 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.4 - 5.3.9
DateTime Object ( [date] => 2016-02-20 23:52:19 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.1 - 5.3.3
DateTime Object ( [date] => 2016-02-20 23:52:20 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.0
DateTime Object ( [date] => 2016-02-20 23:52:21 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 4 DateTime Object ( )
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 4 Fatal error: Class 'DateTime' not found in /in/NlEaA on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 4 Fatal error: Cannot instantiate non-existent class: datetime in /in/NlEaA on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/NlEaA on line 4 Fatal error: Cannot instantiate non-existent class: datetime in /in/NlEaA on line 2