3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new DateTime('-1 year'));
Output for 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000093" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000112" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000080" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.010605" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.009935" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000137" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000091" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:54.000081" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000092" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000098" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.050541" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000117" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.031211" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.054824" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.025313" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000104" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000105" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.001889" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.003818" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.006099" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.004502" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.014404" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.018758" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.007882" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.005169" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-03 15:29:15.004732" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.031035" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.017336" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-03 15:29:15.003560" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-03 15:29:15.012801" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-03 15:29:15.005538" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.051184" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.26 - 5.6.27, 5.6.29 - 5.6.30, hhvm-3.11.1 - 3.12.14, hhvm-3.15.4, hhvm-3.18.4 - 3.20.2, hhvm-3.22.0, 7.0.11 - 7.0.19, 7.0.21 - 7.0.30, 7.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.039426" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:53.005535" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-03 15:29:15.003955" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.25, 5.6.28, 7.0.0 - 7.0.10, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-03 15:29:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.10.1, hhvm-3.13.2, hhvm-3.17.3, hhvm-3.21.0 - 3.21.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-12 14:40:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.0 - 5.4.29, 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-02-03 15:29:15" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }