3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTimeImmutable('now'); $new_date = $date->modify('-10 days'); var_dump($date); var_dump($new_date);
Output for 7.1.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-07-04 16:25:44.004064" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2014-06-24 16:25:44.004064" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-07-04 16:25:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2014-06-24 16:25:44.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:20:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-23 18:20:13.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:45:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-24 06:45:56.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:32:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-02-29 18:32:11.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:39:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-08 19:39:43.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:47:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-13 01:47:14.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:27:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-14 05:27:48.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:24:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-17 07:24:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.12.0
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-13 09:54:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-03 09:54:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } }
Output for hhvm-3.10.0
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-31 01:35:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-21 01:35:16.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:29:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-22 13:29:38.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:45:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-31 05:45:16.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:43:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-02-27 02:43:12.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:26:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-05 11:26:19.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:05:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-09 23:05:59.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:11:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-18 08:11:28.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:02:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-19 09:02:04.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 10:53:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-23 10:53:41.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:17:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-05 15:17:01.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:46:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-10 05:46:17.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:08:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-14 12:08:03.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:11:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-15 14:11:32.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:21:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-17 19:21:32.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:14:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-20 04:14:06.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:20:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-05-12 20:20:34.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 07:57:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-01 07:57:00.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:24:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-02-28 05:24:54.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:20:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-07 15:20:46.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:07:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-11 02:07:09.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 10:55:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-22 10:55:39.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:40:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-07 05:40:47.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 08:59:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-11 08:59:24.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:46:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-12 10:46:47.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 16:54:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-16 16:54:08.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:46:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-18 23:46:27.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:19:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-05-14 06:19:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/SWLdV on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/SWLdV on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/SWLdV on line 3