3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $begin = new DateTime( '2012-08-01' ); $end = new DateTime( '2012-08-31' ); $end = $end->modify( '+1 day' ); $interval = new DateInterval('P1D'); $daterange = new DatePeriod($begin, $interval ,$end); foreach($daterange as $date){ echo $date->format('m').'<br/>'; }
based on 451e3
Output for 5.3.0 - 7.2.0
08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>08<br/>
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/BIQZu on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/BIQZu on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/BIQZu on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/BIQZu on line 2