3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('-5 minute'); echo $date->format('Y-m-d H:i:s') . PHP_EOL; $date = new DateTime(); echo $date->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 7.1.0
2014-03-10 22:18:47 2014-03-10 22:23:47
Output for 7.0.6
2016-05-03 02:07:26 2016-05-03 02:12:26
Output for 7.0.5
2016-04-02 15:22:39 2016-04-02 15:27:39
Output for 7.0.4
2016-03-10 00:50:57 2016-03-10 00:55:57
Output for 7.0.3
2016-03-18 01:03:11 2016-03-18 01:08:11
Output for 7.0.2
2016-03-21 11:38:16 2016-03-21 11:43:16
Output for 7.0.1
2016-03-23 11:50:01 2016-03-23 11:55:01
Output for 7.0.0
2016-03-26 14:21:21 2016-03-26 14:26:21
Output for hhvm-3.12.0
2016-03-11 05:24:28 2016-03-11 05:29:28
Output for hhvm-3.10.0
2016-03-29 19:17:26 2016-03-29 19:22:26
Output for 5.6.21
2016-05-01 21:09:46 2016-05-01 21:14:46
Output for 5.6.20
2016-04-09 10:37:27 2016-04-09 10:42:27
Output for 5.6.19
2016-03-06 23:06:16 2016-03-06 23:11:16
Output for 5.6.18
2016-03-14 10:46:30 2016-03-14 10:51:30
Output for 5.6.17
2016-03-19 05:32:08 2016-03-19 05:37:08
Output for 5.6.16
2016-03-27 16:06:24 2016-03-27 16:11:24
Output for 5.6.15
2016-03-28 17:00:00 2016-03-28 17:05:00
Output for 5.6.14
2016-04-01 19:38:30 2016-04-01 19:43:30
Output for 5.6.13
2016-04-14 23:26:25 2016-04-14 23:31:25
Output for 5.6.12
2016-04-19 12:34:42 2016-04-19 12:39:42
Output for 5.6.11
2016-04-22 19:50:47 2016-04-22 19:55:47
Output for 5.6.10
2016-04-24 21:30:49 2016-04-24 21:35:49
Output for 5.6.9
2016-04-27 02:39:56 2016-04-27 02:44:56
Output for 5.6.8
2016-04-29 10:15:08 2016-04-29 10:20:08
Output for 5.6.7
2016-05-24 20:55:31 2016-05-24 21:00:31
Output for 5.5.35
2016-05-22 00:30:05 2016-05-22 00:35:05
Output for 5.5.34
2016-04-10 16:33:07 2016-04-10 16:38:07
Output for 5.5.33
2016-03-08 11:45:06 2016-03-08 11:50:06
Output for 5.5.32
2016-03-16 17:25:44 2016-03-16 17:30:44
Output for 5.5.31
2016-03-20 08:25:07 2016-03-20 08:30:07
Output for 5.5.30
2016-03-31 19:01:26 2016-03-31 19:06:26
Output for 5.5.29
2016-04-16 13:33:08 2016-04-16 13:38:08
Output for 5.5.28
2016-04-20 15:49:05 2016-04-20 15:54:05
Output for 5.5.27
2016-04-21 18:22:33 2016-04-21 18:27:33
Output for 5.5.26
2016-04-25 23:48:09 2016-04-25 23:53:09
Output for 5.5.25
2016-04-28 05:56:21 2016-04-28 06:01:21
Output for 5.5.24
2016-04-30 13:27:39 2016-04-30 13:32:39
Output for 5.4.45
2015-09-14 04:14:10 2015-09-14 04:19:10
Output for 5.4.44
2015-09-14 04:14:07 2015-09-14 04:19:07
Output for 5.4.43
2015-09-14 04:14:03 2015-09-14 04:19:03
Output for 5.4.42
2015-09-14 04:14:02 2015-09-14 04:19:02
Output for 5.4.41
2015-09-14 04:14:00 2015-09-14 04:19:00
Output for 5.4.40
2015-05-10 16:55:20 2015-05-10 17:00:20
Output for 5.4.39
2015-05-10 16:55:19 2015-05-10 17:00:19
Output for 5.4.38
2015-03-02 13:38:25 2015-03-02 13:43:25
Output for 5.4.36 - 5.4.37
2015-02-08 09:35:05 2015-02-08 09:40:05
Output for 5.4.34 - 5.4.35
2015-02-08 09:35:04 2015-02-08 09:40:04
Output for 5.4.32
2014-09-07 09:05:37 2014-09-07 09:10:37
Output for 5.4.27, 5.4.31
2014-09-07 09:05:35 2014-09-07 09:10:35
Output for 5.4.28 - 5.4.30
2014-09-07 09:05:31 2014-09-07 09:10:31
Output for 5.4.5 - 5.4.26
2014-03-10 22:18:48 2014-03-10 22:23:48
Output for 5.3.12 - 5.3.28, 5.4.0 - 5.4.4
2014-03-10 22:18:49 2014-03-10 22:23:49
Output for 5.3.29
2014-09-07 09:05:32 2014-09-07 09:10:32
Output for 5.2.6 - 5.3.11
2014-03-10 22:18:50 2014-03-10 22:23:50
Output for 5.2.0 - 5.2.5
2014-03-10 22:18:51 2014-03-10 22:23:51
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/1GpUV 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/1GpUV 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/1GpUV on line 3