3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getStandardOffsetFromUTC($timezone) { $timezone = new DateTimeZone($timezone); $transitions = array_slice($timezone->getTransitions(), -3); foreach (array_reverse($transitions) as $transition) { if ($transition['isdst'] == 1) // we are interested in standard offsets only { continue; } return sprintf('UTC %+03d:%02u', $transition['offset'] / 3600, abs($transition['offset']) % 3600 / 60); } return false; } echo getStandardOffsetFromUTC('America/Argentina/San_Luis') . "\n"; echo getStandardOffsetFromUTC('Antarctica/Casey') . "\n"; echo getStandardOffsetFromUTC('Antarctica/Davis') . "\n";
Output for git.master, git.master_jit, rfc.property-hooks
UTC -03:00 UTC +11:00 UTC +07:00

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:
51.37 ms | 401 KiB | 8 Q