3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime('now'); $tomorrow = clone $now; $tomorrow->add(new DateInterval('P1D')); var_dump($tomorrow);
Output for 7.1.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2014-07-12 17:11:15.003974" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2014-07-12 17:11:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-04 08:00:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-03 20:57:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-11 07:13:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-19 07:45:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-23 13:30:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-24 18:32:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-27 20:13:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-03 03:19:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-10 19:47:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-08 15:19:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-15 23:04:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-20 12:03:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-28 21:58:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-29 22:52:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-03 01:26:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-16 05:21:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-20 18:57:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-24 01:57:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-26 03:48:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-28 08:45:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-30 16:44:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.7
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-26 10:46:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-23 07:01:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-11 22:14:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-09 18:09:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-18 00:55:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-21 14:51:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-02 01:00:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-17 19:26:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-21 22:03:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-23 00:34:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-27 06:14:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-29 12:17:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-24 19:12:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41 - 5.4.42
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.39 - 5.4.40
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.36 - 5.4.38
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34 - 5.4.35
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.31
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-20 13:18:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.28 - 5.4.29
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:32" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.25 - 5.4.27
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:33" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.23 - 5.4.24
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:34" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.19 - 5.4.22
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:35" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.26 - 5.3.27, 5.4.17 - 5.4.18
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:36" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.24 - 5.3.25, 5.4.13 - 5.4.16
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:37" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.20 - 5.3.23, 5.4.10 - 5.4.12
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:38" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.17 - 5.3.19, 5.4.8 - 5.4.9
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:39" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.14 - 5.3.16, 5.4.4 - 5.4.7
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:40" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.11 - 5.3.13, 5.4.1 - 5.4.3
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:41" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.5 - 5.3.10, 5.4.0
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:42" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:31" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.2 - 5.3.4
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:43" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.1
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-20 13:18:44" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/gvhMR on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/gvhMR on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/gvhMR on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/gvhMR on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/gvhMR on line 3
Process exited with code 255.