3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = [ '2021-07-05', '2021-07-06', '2021-07-07', '2021-07-08', '2021-07-09', '2021-07-10', '2021-07-11', '2021-07-12', '2021-07-13', '2021-07-14', '2021-07-15', '2021-07-16', '2021-07-17', '2021-07-18', '2021-07-19', '2021-07-20', '2021-07-21', '2021-07-22', ]; $from = $dates[0]; $to = $from; $result = []; foreach($dates as $date) { if (strtotime($from) + 60 * 60 * 24 * 6 < strtotime($date)) { $result[] = ['from' => $from, 'to' => $to]; $from = $to; } $to = $date; } $result[] = ['from' => $from, 'to' => $to]; print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [from] => 2021-07-05 [to] => 2021-07-11 ) [1] => Array ( [from] => 2021-07-11 [to] => 2021-07-17 ) [2] => Array ( [from] => 2021-07-17 [to] => 2021-07-22 ) )

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:
55.55 ms | 402 KiB | 8 Q