3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $begin = new DateTime(); $end = (clone $begin)->modify('next year'); $interval = new DateInterval('P1M'); $daterange = new DatePeriod($begin, $interval ,$end); foreach($daterange as $date){ echo $date->format("Ymd") . "<br>"; }
based on AdAVW
Output for hhvm-3.15.4, 7.0.0 - 7.3.0alpha1
20170629<br>20170729<br>20170829<br>20170929<br>20171029<br>20171129<br>20171229<br>20180129<br>20180301<br>20180401<br>20180501<br>20180601<br>
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/mDArn on line 3
Process exited with code 255.