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 minutes'); echo $dateTime -> format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 7.1.0
2014-04-08 10:53:542014-04-08 10:43:54
Output for 7.0.6
2016-05-03 01:55:032016-05-03 01:45:03
Output for 7.0.5
2016-04-02 15:12:202016-04-02 15:02:20
Output for 7.0.4
2016-03-10 00:38:022016-03-10 00:28:02
Output for 7.0.3
2016-03-18 00:50:422016-03-18 00:40:42
Output for 7.0.2
2016-03-21 11:26:082016-03-21 11:16:08
Output for 7.0.1
2016-03-23 11:37:342016-03-23 11:27:34
Output for 7.0.0
2016-03-26 14:10:132016-03-26 14:00:13
Output for 5.6.21
2016-05-01 20:58:462016-05-01 20:48:46
Output for 5.6.20
2016-04-09 10:27:292016-04-09 10:17:29
Output for 5.6.19
2016-03-06 22:42:322016-03-06 22:32:32
Output for 5.6.18
2016-03-14 10:16:452016-03-14 10:06:45
Output for 5.6.17
2016-03-19 05:19:532016-03-19 05:09:53
Output for 5.6.16
2016-03-27 15:54:022016-03-27 15:44:02
Output for 5.6.15
2016-03-28 16:48:232016-03-28 16:38:23
Output for 5.6.14
2016-04-01 19:28:122016-04-01 19:18:12
Output for 5.6.13
2016-04-14 23:15:522016-04-14 23:05:52
Output for 5.6.12
2016-04-19 12:23:292016-04-19 12:13:29
Output for 5.6.11
2016-04-22 19:39:362016-04-22 19:29:36
Output for 5.6.10
2016-04-24 21:19:292016-04-24 21:09:29
Output for 5.6.9
2016-04-27 02:27:582016-04-27 02:17:58
Output for 5.6.8
2016-04-29 10:01:082016-04-29 09:51:08
Output for 5.6.7
2016-05-24 20:42:182016-05-24 20:32:18
Output for 5.5.35
2016-05-22 00:15:232016-05-22 00:05:23
Output for 5.5.34
2016-04-10 16:22:422016-04-10 16:12:42
Output for 5.5.33
2016-03-08 11:33:192016-03-08 11:23:19
Output for 5.5.32
2016-03-16 17:12:352016-03-16 17:02:35
Output for 5.5.31
2016-03-20 08:13:062016-03-20 08:03:06
Output for 5.5.30
2016-03-31 18:50:382016-03-31 18:40:38
Output for 5.5.29
2016-04-16 13:21:462016-04-16 13:11:46
Output for 5.5.28
2016-04-20 15:36:432016-04-20 15:26:43
Output for 5.5.27
2016-04-21 18:11:372016-04-21 18:01:37
Output for 5.5.26
2016-04-25 23:36:452016-04-25 23:26:45
Output for 5.5.25
2016-04-28 05:44:292016-04-28 05:34:29
Output for 5.5.24
2016-04-30 13:17:302016-04-30 13:07:30
Output for 5.4.45
2015-09-20 23:01:212015-09-20 22:51:21
Output for 5.4.44
2015-09-03 10:47:152015-09-03 10:37:15
Output for 5.4.43
2015-07-18 14:43:282015-07-18 14:33:28
Output for 5.4.42
2015-07-18 14:43:272015-07-18 14:33:27
Output for 5.4.41
2015-05-26 02:00:182015-05-26 01:50:18
Output for 5.4.40
2015-05-15 08:31:572015-05-15 08:21:57
Output for 5.4.39
2015-05-15 08:31:562015-05-15 08:21:56
Output for 5.4.38
2015-03-02 20:01:232015-03-02 19:51:23
Output for 5.4.37
2015-02-09 00:41:522015-02-09 00:31:52
Output for 5.4.34 - 5.4.36
2015-02-09 00:41:512015-02-09 00:31:51
Output for 5.4.32
2014-09-08 21:16:122014-09-08 21:06:12
Output for 5.4.31
2014-09-08 21:16:092014-09-08 21:06:09
Output for 5.3.29, 5.4.29 - 5.4.30
2014-09-08 21:16:062014-09-08 21:06:06
Output for 5.4.28
2014-09-08 21:16:052014-09-08 21:06:05
Output for 5.4.20 - 5.4.27
2014-04-08 10:53:552014-04-08 10:43:55
Output for 5.4.1 - 5.4.19
2014-04-08 10:53:562014-04-08 10:43:56
Output for 5.3.8 - 5.3.28, 5.4.0
2014-04-08 10:53:572014-04-08 10:43:57
Output for 5.2.0 - 5.3.7
2014-04-08 10:53:582014-04-08 10:43:58
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/8oICE 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/8oICE 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/8oICE on line 3