3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new \DateTime("-5 years -1 month"));
based on N9CFa
Output for 7.3.0rc3
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.031903" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0beta1
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.002865" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0alpha1
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.001484" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.004800" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.004459" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.003819" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.004257" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.007644" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.015327" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.015572" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.016078" ["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) "2012-06-04 12:42:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.019238" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.004681" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-06-04 12:42:00.005028" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }