3v4l.org

run code in 200+ php & hhvm versions
<?php $date = new DateTime(); var_dump($date); var_Dump($date->date); echo "\n"; echo $date->date; echo "\n"; print($date->date); echo "\n\n"; $date1 = new DateTime(); var_dump($date1->date);
based on H2JOm
Output for 7.1.25, 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000139" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000139" 2017-01-11 18:11:51.000139 2017-01-11 18:11:51.000139 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000164" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000164" 2017-01-11 18:11:51.000164 2017-01-11 18:11:51.000164 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000133" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000133" 2017-01-11 18:11:51.000133 2017-01-11 18:11:51.000133 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000095" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000095" 2017-01-11 18:11:51.000095 2017-01-11 18:11:51.000095 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000098" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000098" 2017-01-11 18:11:51.000098 2017-01-11 18:11:51.000098 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000105" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000105" 2017-01-11 18:11:51.000105 2017-01-11 18:11:51.000105 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000142" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000142" 2017-01-11 18:11:51.000142 2017-01-11 18:11:51.000142 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000120" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000120" 2017-01-11 18:11:51.000120 2017-01-11 18:11:51.000120 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000119" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000119" 2017-01-11 18:11:51.000119 2017-01-11 18:11:51.000119 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000115" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000115" 2017-01-11 18:11:51.000115 2017-01-11 18:11:51.000115 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.0, 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000104" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000104" 2017-01-11 18:11:51.000104 2017-01-11 18:11:51.000104 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.1, 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000124" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000124" 2017-01-11 18:11:51.000124 2017-01-11 18:11:51.000124 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000168" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000168" 2017-01-11 18:11:51.000168 2017-01-11 18:11:51.000168 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000126" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000126" 2017-01-11 18:11:51.000126 2017-01-11 18:11:51.000126 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.003999" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.003999" 2017-01-11 18:11:51.003999 2017-01-11 18:11:51.003999 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.004198" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.004198" 2017-01-11 18:11:51.004198 2017-01-11 18:11:51.004198 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.005307" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.005307" 2017-01-11 18:11:51.005307 2017-01-11 18:11:51.005307 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.005169" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.005169" 2017-01-11 18:11:51.005169 2017-01-11 18:11:51.005169 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.011173" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.011173" 2017-01-11 18:11:51.011173 2017-01-11 18:11:51.011173 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.004288" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.004288" 2017-01-11 18:11:51.004288 2017-01-11 18:11:51.004288 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL
Output for 5.6.0 - 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-11 18:11:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(26) "2017-01-11 18:11:51.000000" 2017-01-11 18:11:51.000000 2017-01-11 18:11:51.000000 Notice: Undefined property: DateTime::$date in /in/bEv47 on line 12 NULL