3v4l.org

run code in 200+ PHP versions simultaneously
<?php $d = new \DateTimeImmutable(); var_dump($d) ;var_dump($d->modify('+2 years'));
based on 75CRe
Output for 7.4.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000206" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000206" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0rc6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000187" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000187" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0rc5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000326" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000326" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.23, 7.3.5, 7.4.0rc4
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000229" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000229" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0rc3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000267" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000267" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0rc2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000215" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000215" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0beta4 - 7.4.0rc1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000210" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000210" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0beta2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000291" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000291" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0beta1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000251" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000251" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0alpha3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000290" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000290" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0alpha2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000219" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000219" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0alpha1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000289" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000289" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.19, 7.3.10, 7.3.12
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000208" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000208" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.11
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000209" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000209" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.9
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000266" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000266" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.8
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000358" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000358" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.7
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000308" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000308" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000302" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000302" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.4
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000239" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000239" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000207" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000207" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000183" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000183" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000148" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000148" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000165" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000165" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.25
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000342" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000342" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.18, 7.2.24
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000257" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000257" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.22
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000376" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000376" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.17, 7.2.21
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000238" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000238" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000313" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000313" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.33
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000172" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000172" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.32
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000158" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000158" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.31
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000168" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000168" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.30
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000153" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000153" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.29
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000157" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000157" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.28
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000181" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000181" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.27
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000182" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000182" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.26
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2019-12-03 08:39:45.000161" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2021-12-03 08:39:45.000161" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }