3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $interval = new DateInterval('P14M'); $now = new DateTime(); var_dump($now->add($interval));
Output for 7.1.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-05-14 14:26:40.004775" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-05-14 14:26:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-07-03 02:14:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-02 15:29:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-10 00:58:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-18 01:10:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-21 11:45:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-23 11:57:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-26 14:28:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.12.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-11 05:33:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.10.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-29 19:25:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-07-01 21:17:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-09 10:44:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-06 23:13:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-14 10:58:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-19 05:39:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-27 16:13:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-28 17:07:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-01 19:45:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-14 23:33:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-19 12:42:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-22 19:58:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-24 21:38:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-27 02:47:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-29 10:22:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.7
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-07-24 21:03:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-07-22 00:38:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-10 16:40:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-08 11:52:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-16 17:33:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-20 08:32:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-05-31 19:08:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-16 13:40:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-20 15:56:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-21 18:29:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-25 23:55:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-28 06:04:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#2 (3) { ["date"]=> string(26) "2017-06-30 13:34:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 05:48:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 05:48:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 05:48:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.42
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 05:48:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 05:48:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-07-10 18:46:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.39
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-07-10 18:46:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.38
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-02 14:52:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.37
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-08 15:05:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.35 - 5.4.36
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-08 15:05:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34
object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-08 15:05:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-07 14:22:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-07 14:22:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30
object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-07 14:22:40.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-07 14:22:39" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.27
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-07 14:22:44" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.24 - 5.4.26
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-05-14 14:26:41" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.3 - 5.4.23
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-05-14 14:26:42" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.10 - 5.3.28, 5.4.0 - 5.4.2
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-05-14 14:26:43" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-07 14:22:40" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.9
object(DateTime)#2 (3) { ["date"]=> string(19) "2015-05-14 14:26:44" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.0.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/apHJO on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: dateinterval in /in/apHJO on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: dateinterval in /in/apHJO on line 3