3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('America/Los_Angeles'); $local = new DateTimeZone('America/Los_Angeles'); /* $totSecs = $local->getOffset(new DateTime()); $totSecs -= .5 * 3600; $hrs = floor($totSecs / (60 * 60)); $mins = floor(($totSecs - $hrs * 60 * 60) / 60); echo $hrs . ':' . $mins; */ var_dump($local->format('T'));
Output for 7.0.0 - 7.3.0rc6
Fatal error: Uncaught Error: Call to undefined method DateTimeZone::format() in /in/6Xof4:11 Stack trace: #0 {main} thrown in /in/6Xof4 on line 11
Process exited with code 255.
Output for 5.2.0 - 5.6.28
Fatal error: Call to undefined method DateTimeZone::format() in /in/6Xof4 on line 11
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/6Xof4 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/6Xof4 on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/6Xof4 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/6Xof4 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/6Xof4 on line 2