3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date1 = new \DateTime('2006-04-12T12:30:00'); $date2 = new \DateTime('2006-04-14T11:30:00'); //determine what interval should be used - can change to weeks, months, etc $interval = new \DateInterval('PT1H'); //create periods every hour between the two dates $periods = new \DatePeriod($date1, $interval, $date2); //count the number of objects within the periods $hours = iterator_count($periods); echo $hours . ' hours';
Output for git.master, git.master_jit, rfc.property-hooks
47 hours

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:
80.6 ms | 401 KiB | 8 Q