3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php$begin = new DateTime( '2007-12-31' );$end = new DateTime( '2009-12-31 23:59:59' );$interval = DateInterval::createFromDateString('last thursday of next month');$period = new DatePeriod($begin, $interval, $end, DatePeriod::EXCLUDE_START_DATE);foreach ( $period as $dt )  echo $dt->format( "l Y-m-d H:i:s\n" );?>
Output for 5.4.0 - 5.4.32
<?php$begin = new DateTime( '2007-12-31' );$end = new DateTime( '2009-12-31 23:59:59' );$interval = DateInterval::createFromDateString('last thursday of next month');$period = new DatePeriod($begin, $interval, $end, DatePeriod::EXCLUDE_START_DATE);foreach ( $period as $dt )  echo $dt->format( "l Y-m-d H:i:s\n" );?>