3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace my\name; class DateTime { } $myDateTime = new DateTime(); $dateTime = new \DateTime(); var_dump($myDateTime, $dateTime);
Output for 7.2.0
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.003865" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.030260" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.042466" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.038173" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.005615" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.30, hhvm-3.10.1 - 3.12.14, hhvm-3.15.4 - 3.17.3, 7.0.0 - 7.0.3, 7.0.5 - 7.0.20, 7.1.3
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.015163" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.029244" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:36.003144" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.13.2, 7.0.4
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-11-14 16:36:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
object(my\name\DateTime)#1 (0) { } object(DateTime)#2 (3) { ["date"]=> string(19) "2016-11-14 16:36:36" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/Cj71E on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/Cj71E on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Cj71E on line 2
Process exited with code 255.