3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tz2 = 'America/Los_Angeles'; $tz = 'GMT'; $d = new \DateTime(); $d->setTimezone(new \DateTimeZone($tz)); $date_from = ($d)->setTimestamp(0); $date_from->setTimezone(new \DateTimeZone($tz2)); echo $date_from->format('c');
Output for hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.2.9
1969-12-31T16:00:00-08:00
Output for 5.6.30
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/nQ6mc on line 6
Process exited with code 255.