3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = new DateTime("1206-03-04 00:00:00 Europe/Berlin"); $date = new DateTime("2016-06-03 22:00:00 UTC"); $interval = new DateInterval('P10D'); echo ceilDateTimeByInterval($date, $interval, $base)->format('Y-m-d H:i:s e'); function ceilDateTimeByInterval(DateTime $date, DateInterval $interval, DateTime $base) { if ($date < $base) { return null; } $result = clone $base; while ($date > $result) { $result = $result->add($interval); } $result = $result->setTimezone($date->getTimezone()); return $result; }
Output for git.master, git.master_jit, rfc.property-hooks
2016-06-04 22:06:32 UTC

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:
64.86 ms | 405 KiB | 5 Q