3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $utc = new DateTimeZone('UTC'); $start = new DateTime('2015-09-01', $utc); $end = new DateTime('2015-09-02', $utc); $interval = new DateTimeInterval('P1D'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $current) { $currentEnd = clone $current; $currentEnd->add($period->interval); var_dump($current, $currentEnd); }
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Class 'DateTimeInterval' not found in /in/QjhCZ:6 Stack trace: #0 {main} thrown in /in/QjhCZ on line 6
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Class 'DateTimeInterval' not found in /in/QjhCZ on line 6
Process exited with code 255.