3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $days = 7; $date1 = new \DateTime())->add(new \DateInterval('P'.($days -1).'D'); $date2 = new DateTime()->modify('+'.$days.' day'); var_dump($date1, $date2);
Output for 5.3.0 - 5.4.25
Parse error: syntax error, unexpected ')' in /in/37Pc8 on line 3
Process exited with code 255.