3v4l.org

run code in 500+ PHP versions simultaneously
<?php function number_of_working_days($startDate, $endDate) { $workingDays = 0; $startTimestamp = strtotime($startDate); $endTimestamp = strtotime($endDate); echo $startTimestamp . "\n"; echo $endTimestamp . "\n"; for ($i = $startTimestamp; $i <= $endTimestamp; $i = $i + (60 * 60 * 24)) { if (date("N", $i) <= 5) $workingDays = $workingDays + 1; echo $i.' '.date("d.m.Y H:i:s", $i).' '.date("D", $i).' '.date("N", $i).' '.$workingDays."\n"; } return $workingDays; } echo number_of_working_days('2016-10-20', '2016-10-31');
Output for git.master, git.master_jit, rfc.property-hooks
1476914400 1477868400 1476914400 20.10.2016 00:00:00 Thu 4 1 1477000800 21.10.2016 00:00:00 Fri 5 2 1477087200 22.10.2016 00:00:00 Sat 6 2 1477173600 23.10.2016 00:00:00 Sun 7 2 1477260000 24.10.2016 00:00:00 Mon 1 3 1477346400 25.10.2016 00:00:00 Tue 2 4 1477432800 26.10.2016 00:00:00 Wed 3 5 1477519200 27.10.2016 00:00:00 Thu 4 6 1477605600 28.10.2016 00:00:00 Fri 5 7 1477692000 29.10.2016 00:00:00 Sat 6 7 1477778400 30.10.2016 00:00:00 Sun 7 7 1477864800 30.10.2016 23:00:00 Sun 7 7 7

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:
28.2 ms | 1722 KiB | 4 Q