3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = new DateTimeImmutable(); $y = new DateTimeImmutable(); $y = $y->add(new DateInterval("P1D")); var_dump($x, $y);
Output for 7.2.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.005963" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.005971" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.004609" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.004619" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.003021" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.003028" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.012954" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.012966" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.007401" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.007412" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.004046" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.004051" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-11-08 17:05:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2015-11-09 17:05:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-03 18:30:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-05-04 18:30:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-03 06:55:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-04 06:55:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-10 18:42:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-11 18:42:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-18 19:51:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-19 19:51:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-23 01:58:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-24 01:58:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-24 05:38:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-25 05:38:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-27 07:34:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-28 07:34:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-02 13:40:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-05-03 13:40:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-10 05:55:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-11 05:55:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-08 02:54:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-09 02:54:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-15 11:37:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-16 11:37:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-19 23:17:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-20 23:17:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-28 08:21:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-29 08:21:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-29 09:12:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-30 09:12:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-02 11:03:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-03 11:03:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-15 15:27:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-16 15:27:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-20 05:57:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-21 05:57:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-24 12:19:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-25 12:19:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-25 14:22:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-26 14:22:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-27 19:32:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-28 19:32:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-30 04:24:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-05-01 04:24:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-22 20:55:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-05-23 20:55:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-11 08:07:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-12 08:07:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-09 05:37:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-10 05:37:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-17 15:33:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-18 15:33:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-21 02:19:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-03-22 02:19:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-01 11:06:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-02 11:06:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-17 05:51:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-18 05:51:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-21 09:10:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-22 09:10:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-22 10:57:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-23 10:57:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-26 17:05:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-27 17:05:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-28 23:57:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-04-29 23:57:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-24 06:30:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#4 (3) { ["date"]=> string(26) "2016-05-25 06:30:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.19 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/AudHt on line 3
Process exited with code 255.