3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Berlin'); $dt = new DateTimeImmutable('2008-03-01T13:00:00Z'); var_dump($dt, $dt->getOffset(), $dt->modify('+6month'), $dt->modify('+6month')->getOffset()); var_dump(DateTimeImmutable::createFromFormat('Y-m-d\\TH:i:sT', '2008-03-01T13:00:00Z')); var_dump(DateTimeImmutable::createFromFormat('Y-m-d\\TH:i:sO', '2008-03-01T13:00:00Z')); var_dump(DateTimeImmutable::createFromFormat('Y-m-d\\TH:i:sP', '2008-03-01T13:00:00Z')); $dp = DatePeriod::createFromISO8601String('R1/2008-03-01T13:00:00Z/P1Y2M10DT2H30M'); foreach ($dp as $d) { var_dump($d); }
Output for git.master_jit, git.master, rfc.property-hooks
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2008-03-01 13:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } int(0) object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2008-09-01 13:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } int(0) object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2008-03-01 13:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2008-03-01 13:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2008-03-01 13:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } object(DateTimeImmutable)#6 (3) { ["date"]=> string(26) "2008-03-01 13:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTimeImmutable)#8 (3) { ["date"]=> string(26) "2009-05-11 15:30:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00: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:
31.27 ms | 409 KiB | 5 Q