3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new DateTime('+10 years'));
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.134358" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.006895" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.004144" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.002699" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.027532" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.038732" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.041121" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.026149" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.0.20, 7.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.034519" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:07.118165" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2027-07-13 12:03:06.007324" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }