3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTimeImmutable('2019-01-01 13:00:00'); $end = new DateTimeImmutable('2019-01-01 14:30:01'); //NOTE 30:01 $interval = new DateInterval('PT1H'); foreach(new DatePeriod($start, $interval, $end) as $date) { echo $date->format('r') . \PHP_EOL; //NOTE: 00:00 and not 30:01 } echo \PHP_EOL; echo 'Sanitized:' . PHP_EOL; $startState = $start->setTime($start->format('H'), 0); $endState = $end->setTime($end->format('H'), 0); foreach(new DatePeriod($startState, $interval, $endState) as $date) { echo $date->format('r') . \PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Tue, 01 Jan 2019 13:00:00 +0100 Tue, 01 Jan 2019 14:00:00 +0100 Sanitized: Tue, 01 Jan 2019 13:00:00 +0100

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.08 ms | 401 KiB | 8 Q