3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $utc = new DateTimeZone('UTC'); $time = DateTime::createFromFormat('Y-m-d H:i:s', '2014-05-19 11:30:00', $utc); foreach (array('UTC', 'Europe/London', 'BST', 'Etc/GMT+1', 'GMT+1', 'CEST', 'EST', 'GMT-5') as $abbr) { $local = clone $time; try { $zone = new DateTimeZone($abbr); $local2 = new DateTime('2014-05-19 11:30:00', $zone); $local->setTimezone(new DateTimeZone($abbr)); echo "{$abbr}: {$zone->getOffset($time)} {$local->format('H:i P')}", PHP_EOL; echo "{$abbr}: {$zone->getOffset($time)} {$local2->format('H:i P')}", PHP_EOL; } catch (Exception $e) { echo "{$abbr}: ERROR - {$e->getMessage()}", PHP_EOL; } }
Output for git.master, git.master_jit, rfc.property-hooks
UTC: 0 11:30 +00:00 UTC: 0 11:30 +00:00 Europe/London: 3600 12:30 +01:00 Europe/London: 3600 11:30 +01:00 BST: 3600 12:30 +01:00 BST: 3600 11:30 +01:00 Etc/GMT+1: -3600 10:30 -01:00 Etc/GMT+1: -3600 11:30 -01:00 GMT+1: 3600 12:30 +01:00 GMT+1: 3600 11:30 +01:00 CEST: 7200 13:30 +02:00 CEST: 7200 11:30 +02:00 EST: -18000 06:30 -05:00 EST: -18000 11:30 -05:00 GMT-5: -18000 06:30 -05:00 GMT-5: -18000 11:30 -05: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:
47.5 ms | 402 KiB | 8 Q