3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $epoch = "1394031420"; $newepoch = time(); $start = new DateTime("@$epoch"); $start->modify('first day of this month'); $end = new DateTime("@$newepoch"); $end->modify('first day of next month'); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { echo $dt->format("M-d-y") . PHP_EOL; $newDate = strtotime('+15 days',$dt) echo $newDate->format("M-d-y") . PHP_EOL; }
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/72Qcr on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ECHO in /in/72Qcr on line 17
Process exited with code 255.