3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); echo $date->format('Y-m-d H:i:s'); $date = new DateTime('-5 minute'); echo $date->format('Y-m-d H:i:s') . PHP_EOL;
Output for 5.6.28, 7.0.14 - 7.1.0
2014-03-10 22:23:572014-03-10 22:18:57
Output for 7.0.6
2016-05-03 02:12:312016-05-03 02:07:31
Output for 7.0.5
2016-04-02 15:27:362016-04-02 15:22:36
Output for 7.0.4
2016-03-10 00:55:532016-03-10 00:50:53
Output for 7.0.3
2016-03-18 01:08:072016-03-18 01:03:07
Output for 7.0.2
2016-03-21 11:43:122016-03-21 11:38:12
Output for 7.0.1
2016-03-23 11:54:572016-03-23 11:49:57
Output for 7.0.0
2016-03-26 14:26:172016-03-26 14:21:17
Output for hhvm-3.12.0
2016-03-11 05:29:222016-03-11 05:24:22
Output for hhvm-3.10.0
2016-03-29 19:22:212016-03-29 19:17:21
Output for 5.6.21
2016-05-01 21:14:512016-05-01 21:09:51
Output for 5.6.20
2016-04-09 10:42:312016-04-09 10:37:31
Output for 5.6.19
2016-03-06 23:11:122016-03-06 23:06:12
Output for 5.6.18
2016-03-14 10:51:182016-03-14 10:46:18
Output for 5.6.17
2016-03-19 05:37:042016-03-19 05:32:04
Output for 5.6.16
2016-03-27 16:11:202016-03-27 16:06:20
Output for 5.6.15
2016-03-28 17:04:572016-03-28 16:59:57
Output for 5.6.14
2016-04-01 19:43:272016-04-01 19:38:27
Output for 5.6.13
2016-04-14 23:31:302016-04-14 23:26:30
Output for 5.6.12
2016-04-19 12:39:462016-04-19 12:34:46
Output for 5.6.11
2016-04-22 19:56:022016-04-22 19:51:02
Output for 5.6.10
2016-04-24 21:35:532016-04-24 21:30:53
Output for 5.6.9
2016-04-27 02:45:012016-04-27 02:40:01
Output for 5.6.8
2016-04-29 10:20:132016-04-29 10:15:13
Output for 5.6.7
2016-05-24 21:00:272016-05-24 20:55:27
Output for 5.5.35
2016-05-22 00:35:092016-05-22 00:30:09
Output for 5.5.34
2016-04-10 16:38:112016-04-10 16:33:11
Output for 5.5.33
2016-03-08 11:50:022016-03-08 11:45:02
Output for 5.5.32
2016-03-16 17:30:402016-03-16 17:25:40
Output for 5.5.31
2016-03-20 08:30:032016-03-20 08:25:03
Output for 5.5.30
2016-03-31 19:06:222016-03-31 19:01:22
Output for 5.5.29
2016-04-16 13:38:132016-04-16 13:33:13
Output for 5.5.28
2016-04-20 15:54:082016-04-20 15:49:08
Output for 5.5.27
2016-04-21 18:27:372016-04-21 18:22:37
Output for 5.5.26
2016-04-25 23:53:132016-04-25 23:48:13
Output for 5.5.25
2016-04-28 06:01:252016-04-28 05:56:25
Output for 5.5.24
2016-04-30 13:32:432016-04-30 13:27:43
Output for 5.4.45
2015-09-14 04:16:372015-09-14 04:11:37
Output for 5.4.44
2015-09-14 04:16:342015-09-14 04:11:34
Output for 5.4.43
2015-09-14 04:16:312015-09-14 04:11:31
Output for 5.4.42
2015-09-14 04:16:302015-09-14 04:11:30
Output for 5.4.41
2015-09-14 04:16:282015-09-14 04:11:28
Output for 5.4.40
2015-05-10 16:56:192015-05-10 16:51:19
Output for 5.4.39
2015-05-10 16:56:182015-05-10 16:51:18
Output for 5.4.38
2015-03-02 13:41:522015-03-02 13:36:52
Output for 5.4.37
2015-02-08 09:37:242015-02-08 09:32:24
Output for 5.4.34 - 5.4.36
2015-02-08 09:37:232015-02-08 09:32:23
Output for 5.4.32
2014-09-07 09:10:522014-09-07 09:05:52
Output for 5.4.31
2014-09-07 09:10:492014-09-07 09:05:49
Output for 5.3.29, 5.4.28 - 5.4.30
2014-09-07 09:10:462014-09-07 09:05:46
Output for 5.4.27
2014-09-07 09:10:502014-09-07 09:05:50
Output for 5.4.13 - 5.4.26
2014-03-10 22:23:582014-03-10 22:18:58
Output for 5.3.20 - 5.3.28, 5.4.0 - 5.4.12
2014-03-10 22:23:592014-03-10 22:18:59
Output for 5.3.1 - 5.3.19
2014-03-10 22:24:002014-03-10 22:19:00
Output for 5.2.0 - 5.3.0
2014-03-10 22:24:012014-03-10 22:19:01
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Gvmgt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/Gvmgt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/Gvmgt on line 3