3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2012-07-01'); $interval = new DateInterval('P7D'); $end = new DateTime('2012-07-31'); echo 'Exclude start date' . PHP_EOL; $period = new DatePeriod($start, $interval, $end, DatePeriod::EXCLUDE_START_DATE); foreach ($period as $date) { echo $date->format('Y-m-d') . PHP_EOL; } echo 'Include start date' . PHP_EOL; $period = new DatePeriod($start, $interval, $end); foreach ($period as $date) { echo $date->format('Y-m-d') . PHP_EOL; }
Output for git.master, git.master_jit
Exclude start date 2012-07-08 2012-07-15 2012-07-22 2012-07-29 Include start date 2012-07-01 2012-07-08 2012-07-15 2012-07-22 2012-07-29

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.71 ms | 459 KiB | 5 Q