3v4l.org

run code in 300+ PHP versions simultaneously
<?php $period = new DatePeriod( new DateTime('08:00:00'), new DateInterval('PT15M'), new DateTime('17:00:01') ); foreach ($period as $dt) { echo $dt->format("H:i") . "\n"; }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
08:00 08:15 08:30 08:45 09:00 09:15 09:30 09:45 10:00 10:15 10:30 10:45 11:00 11:15 11:30 11:45 12:00 12:15 12:30 12:45 13:00 13:15 13:30 13:45 14:00 14:15 14:30 14:45 15:00 15:15 15:30 15:45 16:00 16:15 16:30 16:45 17:00

preferences:
85.24 ms | 403 KiB | 123 Q