3v4l.org

run code in 300+ PHP versions simultaneously
<?php $objToday = new Datetime(); $objFirstOfMonth = new DateTime('first day of this month'); $intNumberOfWorkDays = 0; $obj1Day = new DateInterval('P1D'); while ($objToday > $objFirstOfMonth && $intNumberOfWorkDays <= 5) { if ($objFirstOfMonth->format('N') < 6) { $intNumberOfWorkDays++; } echo sprintf('%s:%s', $intNumberOfWorkDays, $objFirstOfMonth->format('N d.m.Y')) . "\r\n"; $objFirstOfMonth = $objFirstOfMonth->add($obj1Day); } if ($intNumberOfWorkDays == 5) { echo 'Boooyaaah!'; } else { echo $intNumberOfWorkDays; }
Output for git.master, git.master_jit, rfc.property-hooks
0:7 01.11.2015 1:1 02.11.2015 2:2 03.11.2015 3:3 04.11.2015 3

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.88 ms | 401 KiB | 8 Q