3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new \DateTime("-5 years 1 month"));
based on Zk7ge
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.004703" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.003669" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.115170" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.004424" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.007045" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.014793" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.015392" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.015882" ["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-08-04 12:41:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.016983" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.006674" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2012-08-04 12:41:51.004096" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }