3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var = new DateTime('now'); $var2 = $var->modify('+5 minutes'); echo $var->format('Y-m-d H:i:s'); echo PHP_EOL; echo $var2->format('Y-m-d H:i:s');
Output for 7.0.12 - 7.1.0
2014-01-13 00:02:00 2014-01-13 00:02:00
Output for 7.0.6
2016-05-03 05:22:34 2016-05-03 05:22:34
Output for 7.0.5
2016-04-02 18:30:04 2016-04-02 18:30:04
Output for 7.0.4
2016-03-10 04:22:41 2016-03-10 04:22:41
Output for 7.0.3
2016-03-18 04:42:39 2016-03-18 04:42:39
Output for 7.0.2
2016-03-21 15:10:38 2016-03-21 15:10:38
Output for 7.0.1
2016-03-23 15:47:46 2016-03-23 15:47:46
Output for 7.0.0
2016-03-26 17:37:05 2016-03-26 17:37:05
Output for hhvm-3.12.0
2016-03-11 11:29:38 2016-03-11 11:29:38
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
2016-05-02 00:26:36 2016-05-02 00:26:36
Output for 5.6.20
2016-04-09 13:44:49 2016-04-09 13:44:49
Output for 5.6.19
2016-03-07 04:05:59 2016-03-07 04:05:59
Output for 5.6.18
2016-03-14 17:23:11 2016-03-14 17:23:11
Output for 5.6.17
2016-03-19 09:07:12 2016-03-19 09:07:12
Output for 5.6.16
2016-03-27 19:23:11 2016-03-27 19:23:11
Output for 5.6.15
2016-03-28 20:16:17 2016-03-28 20:16:17
Output for 5.6.14
2016-04-01 22:47:30 2016-04-01 22:47:30
Output for 5.6.13
2016-04-15 02:47:59 2016-04-15 02:47:59
Output for 5.6.12
2016-04-19 16:09:03 2016-04-19 16:09:03
Output for 5.6.11
2016-04-22 23:12:29 2016-04-22 23:12:29
Output for 5.6.10
2016-04-25 00:51:16 2016-04-25 00:51:16
Output for 5.6.9
2016-04-27 06:03:57 2016-04-27 06:03:57
Output for 5.6.8
2016-04-29 13:52:05 2016-04-29 13:52:05
Output for 5.6.7
2016-05-25 02:50:42 2016-05-25 02:50:42
Output for 5.5.35
2016-05-22 04:14:29 2016-05-22 04:14:29
Output for 5.5.34
2016-04-10 19:42:44 2016-04-10 19:42:44
Output for 5.5.33
2016-03-08 15:18:50 2016-03-08 15:18:50
Output for 5.5.32
2016-03-16 21:08:47 2016-03-16 21:08:47
Output for 5.5.31
2016-03-20 11:58:20 2016-03-20 11:58:20
Output for 5.5.30
2016-03-31 22:17:29 2016-03-31 22:17:29
Output for 5.5.29
2016-04-16 16:52:48 2016-04-16 16:52:48
Output for 5.5.28
2016-04-20 19:17:32 2016-04-20 19:17:32
Output for 5.5.27
2016-04-21 21:38:11 2016-04-21 21:38:11
Output for 5.5.26
2016-04-26 03:26:42 2016-04-26 03:26:42
Output for 5.5.25
2016-04-28 09:23:45 2016-04-28 09:23:45
Output for 5.5.24
2016-05-23 16:17:17 2016-05-23 16:17:17
Output for 5.4.39 - 5.4.45
2015-11-05 07:43:35 2015-11-05 07:43:35
Output for 5.4.30 - 5.4.38
2015-11-05 07:43:36 2015-11-05 07:43:36
Output for 5.4.22 - 5.4.29
2015-11-05 07:43:37 2015-11-05 07:43:37
Output for 5.4.15 - 5.4.21
2015-11-05 07:43:38 2015-11-05 07:43:38
Output for 5.4.7 - 5.4.14
2015-11-05 07:43:39 2015-11-05 07:43:39
Output for 5.3.28 - 5.4.6
2015-11-05 07:43:40 2015-11-05 07:43:40
Output for 5.3.20 - 5.3.27
2015-11-05 07:43:41 2015-11-05 07:43:41
Output for 5.3.11 - 5.3.19
2015-11-05 07:43:42 2015-11-05 07:43:42
Output for 5.3.3 - 5.3.10
2015-11-05 07:43:43 2015-11-05 07:43:43
Output for 5.3.0 - 5.3.2
2015-11-05 07:43:44 2015-11-05 07:43:44
Output for 5.2.13 - 5.2.17
2015-11-05 07:43:44 Fatal error: Call to a member function format() on a non-object in /in/lS71H on line 8
Process exited with code 255.
Output for 5.2.3 - 5.2.12
2015-11-05 07:43:45 Fatal error: Call to a member function format() on a non-object in /in/lS71H on line 8
Process exited with code 255.
Output for 5.2.0 - 5.2.2
2015-11-05 07:43:46 Fatal error: Call to a member function format() on a non-object in /in/lS71H on line 8
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/lS71H 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/lS71H 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/lS71H on line 3