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") . PHP_EOL; }
based on mDArn
Output for hhvm-3.15.4, 7.0.0 - 7.3.0alpha1
20170629 20170729 20170829 20170929 20171029 20171129 20171229 20180129 20180301 20180401 20180501 20180601
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/mc6Pp on line 3
Process exited with code 255.