3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Madrid'); $start = new DateTime('2017-03-26 01:59:00'); $increments = array( '+60 minutes' => '2017-03-26 03:59:00', '+61 minutes' => '2017-03-26 04:00:00', ); echo 'Start: ' . $start->format('r') . PHP_EOL; $local = $start->getTimezone(); $utc = new DateTimeZone('UTC'); foreach ($increments as $increment => $expected_string) { echo '>>> ' . $increment . PHP_EOL; $expected_end = new DateTime($expected_string); $actual_end = clone $start; $actual_end->setTimezone($utc); $actual_end->modify($increment); $actual_end->setTimezone($local); echo 'Expected end: ' . $expected_end->format('r') . PHP_EOL; echo 'Actual end: ' . $actual_end->format('r') . PHP_EOL; echo ($expected_end->format('c')===$actual_end->format('c') ? 'OK' : 'ERROR') . PHP_EOL; echo PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Start: Sun, 26 Mar 2017 01:59:00 +0100 >>> +60 minutes Expected end: Sun, 26 Mar 2017 03:59:00 +0200 Actual end: Sun, 26 Mar 2017 03:59:00 +0200 OK >>> +61 minutes Expected end: Sun, 26 Mar 2017 04:00:00 +0200 Actual end: Sun, 26 Mar 2017 04:00:00 +0200 OK

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