3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTime('now'); echo $dateTime -> format('Y-m-d H:i:s'); $dateTime -> modify('-10 seconds'); echo $dateTime -> format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 7.1.0
2014-04-08 10:54:522014-04-08 10:54:42
Output for 7.0.6
2016-05-03 00:12:452016-05-03 00:12:35
Output for 7.0.5
2016-04-02 13:47:022016-04-02 13:46:52
Output for 7.0.4
2016-03-09 22:42:212016-03-09 22:42:11
Output for 7.0.3
2016-03-17 23:06:252016-03-17 23:06:15
Output for 7.0.2
2016-03-21 09:49:422016-03-21 09:49:32
Output for 7.0.1
2016-03-23 09:28:312016-03-23 09:28:21
Output for 7.0.0
2016-03-26 12:36:022016-03-26 12:35:52
Output for hhvm-3.12.0
2016-03-11 02:11:452016-03-11 02:11:35
Output for hhvm-3.10.0
2016-03-29 16:43:582016-03-29 16:43:48
Output for 5.6.21
2016-05-01 19:18:342016-05-01 19:18:24
Output for 5.6.20
2016-04-09 09:03:162016-04-09 09:03:06
Output for 5.6.19
2016-03-06 19:56:502016-03-06 19:56:40
Output for 5.6.18
2016-03-14 08:03:562016-03-14 08:03:46
Output for 5.6.17
2016-03-19 03:42:312016-03-19 03:42:21
Output for 5.6.16
2016-03-27 14:19:172016-03-27 14:19:07
Output for 5.6.15
2016-03-28 15:17:082016-03-28 15:16:58
Output for 5.6.14
2016-04-01 18:01:072016-04-01 18:00:57
Output for 5.6.13
2016-04-14 21:57:542016-04-14 21:57:44
Output for 5.6.12
2016-04-19 11:00:372016-04-19 11:00:27
Output for 5.6.11
2016-04-22 18:19:502016-04-22 18:19:40
Output for 5.6.10
2016-04-24 19:57:392016-04-24 19:57:29
Output for 5.6.9
2016-04-27 01:00:572016-04-27 01:00:47
Output for 5.6.8
2016-04-29 08:36:132016-04-29 08:36:03
Output for 5.6.7
2016-05-24 18:10:362016-05-24 18:10:26
Output for 5.5.35
2016-05-21 22:30:542016-05-21 22:30:44
Output for 5.5.34
2016-04-10 14:36:322016-04-10 14:36:22
Output for 5.5.33
2016-03-08 09:49:022016-03-08 09:48:52
Output for 5.5.32
2016-03-15 18:52:382016-03-15 18:52:28
Output for 5.5.31
2016-03-20 06:36:552016-03-20 06:36:45
Output for 5.5.30
2016-03-31 17:23:422016-03-31 17:23:32
Output for 5.5.29
2016-04-16 11:58:292016-04-16 11:58:19
Output for 5.5.28
2016-04-20 14:09:462016-04-20 14:09:36
Output for 5.5.27
2016-04-21 16:50:292016-04-21 16:50:19
Output for 5.5.26
2016-04-25 22:11:482016-04-25 22:11:38
Output for 5.5.25
2016-04-28 04:18:202016-04-28 04:18:10
Output for 5.5.24
2016-04-30 11:59:012016-04-30 11:58:51
Output for 5.4.45
2015-09-11 12:54:262015-09-11 12:54:16
Output for 5.4.44
2015-09-11 12:54:232015-09-11 12:54:13
Output for 5.4.43
2015-07-18 14:42:072015-07-18 14:41:57
Output for 5.4.42
2015-07-18 14:42:052015-07-18 14:41:55
Output for 5.4.41
2015-05-26 01:59:352015-05-26 01:59:25
Output for 5.4.40
2015-05-15 08:32:012015-05-15 08:31:51
Output for 5.4.39
2015-05-15 08:32:002015-05-15 08:31:50
Output for 5.4.38
2015-03-02 20:01:262015-03-02 20:01:16
Output for 5.4.37
2015-02-09 00:41:572015-02-09 00:41:47
Output for 5.4.34 - 5.4.36
2015-02-09 00:41:562015-02-09 00:41:46
Output for 5.4.32
2014-09-08 21:18:002014-09-08 21:17:50
Output for 5.4.31
2014-09-08 21:17:572014-09-08 21:17:47
Output for 5.3.29, 5.4.29 - 5.4.30
2014-09-08 21:17:542014-09-08 21:17:44
Output for 5.4.28
2014-09-08 21:17:532014-09-08 21:17:43
Output for 5.4.15 - 5.4.27
2014-04-08 10:54:532014-04-08 10:54:43
Output for 5.3.23 - 5.3.28, 5.4.0 - 5.4.14
2014-04-08 10:54:542014-04-08 10:54:44
Output for 5.3.0 - 5.3.22
2014-04-08 10:54:552014-04-08 10:54:45
Output for 5.2.0 - 5.2.17
2014-04-08 10:54:562014-04-08 10:54:46
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/QTJlb 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/QTJlb 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/QTJlb on line 3