3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new Datetime('now -2 days'));
based on WvqqX
Output for 7.2.12, 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000107" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000109" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.2, 7.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000154" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000084" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000085" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.007488" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.067478" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.103839" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.016088" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.046062" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.022977" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.049318" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000093" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000115" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000108" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.003875" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.003841" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.002473" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.012451" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.012581" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.003970" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.14 - 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 17:55:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 17:55:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }