3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new DateTime);
Output for 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.011199" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.009397" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.011131" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.006413" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.014778" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.005741" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.005616" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.010346" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.007257" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.005569" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.013622" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.003384" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.003987" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.009600" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.002414" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000184" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.011814" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000163" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000332" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000146" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000142" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.001305" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10, 7.1.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000145" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.17 - 7.1.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000138" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000153" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000155" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000152" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000149" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000150" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.007752" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.003437" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.006697" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000181" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000164" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000148" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.002085" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.5.27, 5.5.29 - 5.6.38, hhvm-3.10.1 - 3.17.3, hhvm-3.18.5 - 3.19.2, hhvm-3.21.0 - 3.22.0, 7.0.0 - 7.0.33, 7.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000217" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000248" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:46.000171" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28, hhvm-3.18.4, hhvm-3.20.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-14 22:30:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.8, 5.3.10 - 5.4.29, 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2019-01-14 22:30:46" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.9
object(DateTime)#1 (3) { ["date"]=> string(19) "2019-01-14 22:30:47" ["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/n66LU on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/n66LU on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/n66LU on line 2