3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date->setTimezone(new DateTimeZone('Pacific/Chatham')); echo $date->format('Y-m-d H:i:sP') . "\n";
based on bMnLk
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: date in /in/Z4cUN on line 2 Fatal error: Uncaught Error: Call to a member function setTimezone() on null in /in/Z4cUN:2 Stack trace: #0 {main} thrown in /in/Z4cUN on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: date in /in/Z4cUN on line 2 Fatal error: Uncaught Error: Call to a member function setTimezone() on unknown in /in/Z4cUN:2 Stack trace: #0 {main} thrown in /in/Z4cUN on line 2
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Notice: Undefined variable: date in /in/Z4cUN on line 2 Fatal error: Call to a member function setTimezone() on null in /in/Z4cUN on line 2
Process exited with code 255.
Output for 5.4.0 - 5.5.38
Notice: Undefined variable: date in /in/Z4cUN on line 2 Fatal error: Call to a member function setTimezone() on a non-object in /in/Z4cUN on line 2
Process exited with code 255.