3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new DateTimeImmutable(); $daySchedule = [ 'from' => '14:00+03:00', 'till' => '21:00+03:00', ]; $from = explode(':', substr($daySchedule['from'], 0, 5)); $till = explode(':', substr($daySchedule['till'], 0, 5)); $fromTz = new \DateTimeZone(substr($daySchedule['from'], 5)); $tillTz = new \DateTimeZone(substr($daySchedule['till'], 5)); $b = $a->setTime($from[0], $from[1]); var_dump($a->getTimestamp()); var_dump($b->getTimestamp()); $b = $b->setTimezone($fromTz); var_dump($a->getTimestamp()); var_dump($b->getTimestamp()); var_dump($a > $b, $a, $b); var_dump($a->getTimestamp()); var_dump($b->getTimestamp()); var_dump($a > $b, $a, $b);
Output for git.master
int(1452860477) int(1452862800) int(1452860477) int(1452862800) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-01-15 13:21:17.003410" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2016-01-15 16:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:00" } int(1452860477) int(1452862800) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-01-15 13:21:17.003410" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2016-01-15 16:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:00" }
Output for git.master_jit
int(1452860477) int(1452862800) int(1452860477) int(1452862800) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-01-15 13:21:17.003822" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2016-01-15 16:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:00" } int(1452860477) int(1452862800) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-01-15 13:21:17.003822" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2016-01-15 16:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:00" }
Output for rfc.property-hooks
int(1452860477) int(1452862800) int(1452860477) int(1452862800) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-01-15 13:21:17.008356" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2016-01-15 16:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:00" } int(1452860477) int(1452862800) bool(false) object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-01-15 13:21:17.008356" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2016-01-15 16:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03: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:
45.35 ms | 402 KiB | 8 Q