3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFutureWeekday( string $startDate, int $numberOfDays, array $holidays = [] ): string { $dt = new DateTime($startDate); for ($i = 0; $i < $numberOfDays; ++$i) { do { $date = $dt->modify('+1 weekday')->format("Y-m-d"); echo $date . "\n"; } while (in_array($date, $holidays)); } echo "---\n"; return $date ?? $startDate; } echo getFutureWeekday('2022-03-30', 4, ['2022-04-05']);
Output for git.master, git.master_jit, rfc.property-hooks
2022-03-31 2022-04-01 2022-04-04 2022-04-05 2022-04-06 --- 2022-04-06

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