3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new DateTime('2 days ago'));
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-11-30 15:48:59.004137" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-11-30 15:48:59.002355" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-11-30 15:48:59.005228" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-11-30 15:48:59.010021" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-11-30 15:48:59.004700" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-11-30 15:48:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.1, 5.3.3, 5.3.6, 5.3.8, 5.3.12, 5.3.14, 5.3.18, 5.3.20 - 5.3.21, 5.3.24, 5.3.27, 5.4.3 - 5.4.4, 5.4.6, 5.4.8, 5.4.11, 5.4.14 - 5.4.29, 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-11-30 15:48:59" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0, 5.3.2, 5.3.4 - 5.3.5, 5.3.7, 5.3.9 - 5.3.11, 5.3.13, 5.3.15 - 5.3.17, 5.3.19, 5.3.22 - 5.3.23, 5.3.25 - 5.3.26, 5.3.28 - 5.4.2, 5.4.5, 5.4.7, 5.4.9 - 5.4.10, 5.4.12 - 5.4.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-11-30 15:48:58" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/ARlo1 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/ARlo1 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/ARlo1 on line 3