3v4l.org

run code in 300+ PHP versions simultaneously
<?php //DateTime $date_mutable = new DateTime('2008-07-01T22:35:17+08:00'); $start_mutable = DateTime::createFromFormat( 'Y-m-d H:i:s.u', $date_mutable->format('Y-m-d').' 00:00:00.000000', $date_mutable->getTimeZone() ); $end_mutable = $start_mutable->add(new DateInterval('P1D')); //DateTimeImmutable $date_immutable = new DateTimeImmutable('2008-07-01T22:35:17+08:00'); $start_immutable = DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s.u', $date_immutable->format('Y-m-d').' 00:00:00.000000', $date_immutable->getTimeZone() ); $end_immutable = $start_immutable->add(new DateInterval('P1D')); var_dump([ 'Date Mutable Formatted' => $date_mutable->format('Y-m-d H:i:s.u P'), 'Start Date Mutable Formatted' => $start_mutable->format('Y-m-d H:i:s.u P'), 'End Date Mutable Formatted' => $end_mutable->format('Y-m-d H:i:s.u P'), 'Date Immutable Formatted' => $date_immutable->format('Y-m-d H:i:s.u P'), 'Start Date Immutable Formatted' => $start_immutable->format('Y-m-d H:i:s.u P'), 'End Date Immutable Formatted' => $end_immutable->format('Y-m-d H:i:s.u P'), ]);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { ["Date Mutable Formatted"]=> string(33) "2008-07-01 22:35:17.000000 +08:00" ["Start Date Mutable Formatted"]=> string(33) "2008-07-02 00:00:00.000000 +08:00" ["End Date Mutable Formatted"]=> string(33) "2008-07-02 00:00:00.000000 +08:00" ["Date Immutable Formatted"]=> string(33) "2008-07-01 22:35:17.000000 +08:00" ["Start Date Immutable Formatted"]=> string(33) "2008-07-01 00:00:00.000000 +08:00" ["End Date Immutable Formatted"]=> string(33) "2008-07-02 00:00:00.000000 +08: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:
162.07 ms | 407 KiB | 5 Q