3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $begin = new DateTime( '2012-08-01' ); $end = new DateTime( '2012-08-31' ); $end = $end->modify( '+1 day' ); $interval = new DateInterval('P0D1M'); $daterange = new DatePeriod($begin, $interval ,$end); foreach($daterange as $date){ echo $date->format("Ymd") . PHP_EOL; }
based on gTNMe
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (P0D1M) in /in/c2QPm:7 Stack trace: #0 /in/c2QPm(7): DateInterval->__construct('P0D1M') #1 {main} thrown in /in/c2QPm on line 7
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (P0D1M)' in /in/c2QPm:-1 Stack trace: #0 /in/c2QPm(-1): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (P0D1M)' in /in/c2QPm:7 Stack trace: #0 /in/c2QPm(7): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (P0D1M)' in /in/c2QPm:7 Stack trace: #0 /in/c2QPm(7): DateInterval->__construct('P0D1M') #1 {main} thrown in /in/c2QPm on line 7
Process exited with code 255.