3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $begin = '2014-3-19'; $end = '2014-5-19'; $begin = new DateTime( $start_date ); $end = new DateTime(date("Y-m-d",strtotime("+1 day", strtotime($end_date)))); while($begin < $end) { $period[] = $begin->format('Y-m-d'); $begin->modify('+1 day'); } var_dump($period);
Output for 5.2.0 - 7.1.7
Notice: Undefined variable: start_date in /in/Ya3pu on line 6 Notice: Undefined variable: end_date in /in/Ya3pu on line 7 Notice: Undefined variable: period in /in/Ya3pu on line 13 NULL
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Ya3pu on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/Ya3pu on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/Ya3pu on line 6