3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = new DateTime(); var_dump($d); var_dump((new DateTime())->date); var_dump($d->date); var_dump($d->timezone_type); var_dump($d->timezone);
based on jR47r
Output for 7.3.0alpha1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.002964" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.002964" int(3) string(16) "Europe/Amsterdam"
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.050500" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.050500" int(3) string(16) "Europe/Amsterdam"
Output for 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.002696" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.002696" int(3) string(16) "Europe/Amsterdam"
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.004766" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.004766" int(3) string(16) "Europe/Amsterdam"
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.004172" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.004172" int(3) string(16) "Europe/Amsterdam"
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.006703" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.006703" int(3) string(16) "Europe/Amsterdam"
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.011167" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.011167" int(3) string(16) "Europe/Amsterdam"
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:12.000001" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:12.000001" int(3) string(16) "Europe/Amsterdam"
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.004210" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.004210" int(3) string(16) "Europe/Amsterdam"
Output for 5.6.0 - 5.6.29, 7.0.0 - 7.0.14, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:13.000000" int(3) string(16) "Europe/Amsterdam"
Output for 5.6.30, 7.0.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL string(26) "2017-01-27 10:49:12.000000" int(3) string(16) "Europe/Amsterdam"
Output for hhvm-3.15.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-27 10:49:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 6 NULL Notice: Undefined property: DateTime::$date in /in/X8Xmr on line 7 NULL Notice: Undefined property: DateTime::$timezone_type in /in/X8Xmr on line 8 NULL Notice: Undefined property: DateTime::$timezone in /in/X8Xmr on line 9 NULL