3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = "2018-05-07"; $end = "2019-07-04"; $times = 0; // Check if first and last month in the range has a 14th. If(date("d", strtotime($start)) <= 14) $times++; If(date("d", strtotime($end)) >= 14) $times++; // Create an array with months between start and end $months = range(strtotime($start . "+1 month"), strtotime($end . "-1 month"), 86400*30); Var_dump($months); // Add the count of the months $times += count($months); Echo $times;
Output for git.master, git.master_jit, rfc.property-hooks
array(13) { [0]=> int(1528322400) [1]=> int(1530914400) [2]=> int(1533506400) [3]=> int(1536098400) [4]=> int(1538690400) [5]=> int(1541282400) [6]=> int(1543874400) [7]=> int(1546466400) [8]=> int(1549058400) [9]=> int(1551650400) [10]=> int(1554242400) [11]=> int(1556834400) [12]=> int(1559426400) } 14

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:
170.19 ms | 406 KiB | 5 Q