3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fromDate = explode("-", '2017-01-28'); $toDate = explode("-", '2017-05-15'); $start = new DateTime('2017-01-28'); $start->modify('first day of this month'); $end = new DateTime('2017-05-15'); $end->modify('first day of next month'); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { $date = $dt->format("Y-m"); $firstDate = $date."-15"; $secondDate = $date."-28"; if((strtotime('2017-05-15') >= strtotime($firstDate)) && (strtotime('2017-01-28') <= strtotime($firstDate))) $res[] = $firstDate; if((strtotime('2017-05-15') >= strtotime($secondDate)) && (strtotime('2017-01-28') <= strtotime($secondDate))) $res[] = $secondDate; } print_r($res);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 2017-01-28 [1] => 2017-02-15 [2] => 2017-02-28 [3] => 2017-03-15 [4] => 2017-03-28 [5] => 2017-04-15 [6] => 2017-04-28 [7] => 2017-05-15 )

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:
59.87 ms | 401 KiB | 8 Q