3v4l.org

run code in 300+ PHP versions simultaneously
<?php $countries = array ( 'London' => 'Europe/London', 'Istanbul' => 'Europe/Istanbul', 'Rome' => 'Europe/Rome', 'Berlin' => 'Europe/Berlin', 'Athens' => 'Europe/Athens', ); $offsets = array(); // initialize foreach($countries as $key => $country_offset) { // grouping $offset = timezone_offset_get( new DateTimeZone( $country_offset ), new DateTime() ); $offsets[$offset][] = array( 'name' => $key, 'offset' => $offset, 'timezome' => $country_offset, ); } ksort($offsets); // sort // presentation foreach($offsets as $offset => $info) { echo $offset . ' - '; $temp = array(); foreach($info as $t) { $temp[] = $t['name']; } echo implode(', ', $temp), "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
3600 - London 7200 - Rome, Berlin 10800 - Istanbul, Athens

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.99 ms | 401 KiB | 8 Q