3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1 = new DateTime('now+02:00'); $d2 = new DateTime(); $d3->setTimezone($d1->getTimezone());
based on X2sD4
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: d3 in /in/UStKm on line 4 Fatal error: Uncaught Error: Call to a member function setTimezone() on null in /in/UStKm:4 Stack trace: #0 {main} thrown in /in/UStKm on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: d3 in /in/UStKm on line 4 Fatal error: Uncaught Error: Call to a member function setTimezone() on unknown in /in/UStKm:4 Stack trace: #0 {main} thrown in /in/UStKm on line 4
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: d3 in /in/UStKm on line 4 Fatal error: Call to a member function setTimezone() on null in /in/UStKm on line 4
Process exited with code 255.
Output for 5.3.19 - 5.5.35
Notice: Undefined variable: d3 in /in/UStKm on line 4 Fatal error: Call to a member function setTimezone() on a non-object in /in/UStKm on line 4
Process exited with code 255.