3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('UTC'); // fill in the blank $timezones = array( 'Sydney' => 'Australia/Sydney', 'Melbourne' => 'Australia/Melbourne', 'New York' => 'America/New_York ); foreach ($timezones as $name => $timezone) { $localTime = new DateTime('now', new DateTimeZone($timezone)); echo "$name: ", $localTime->format('h:ia'); }
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'now' (T_STRING), expecting ')' in /in/UU7LT on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/UU7LT on line 12
Process exited with code 255.