3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTimeImmutable('2012-07-01'); $end = new DateTimeImmutable('2012-07-31'); $interval = new DateInterval('P7D'); $recurrences = 4; $periodWithRecurrences = new DatePeriod($start, $interval, $recurrences); $rc = new ReflectionObject($periodWithRecurrences); print_r($rc->getProperties()); $periodWithoutRecurrences = new DatePeriod($start, $interval, $end); $rc = new ReflectionObject($periodWithoutRecurrences); print_r($rc->getProperties());

preferences:
44.37 ms | 402 KiB | 5 Q