3v4l.org

run code in 300+ PHP versions simultaneously
<?php $duration = 2; $start='01-01-2019'; $month =date('n', strtotime($start)); $year =date('Y', strtotime($start)); $mon = 12-$month+1; $remainingMonth = $duration*12; $years_arr = array("$year"); $residue_arr = array("$remainingMonth"); $years_arr = process($remainingMonth,$year,$mon,$years_arr,$residue_arr); print_r($years_arr); //<output function process($remainingMonth,$year,$mon,$years_arr,$residue_arr){ $residue = $remainingMonth - $mon;//$D$18-D20 if($residue != 0){ $new_year = $year+1; array_push($years_arr, $new_year); array_push($residue_arr, $residue); if($residue > 12 ){ $mon = 12; } else { $mon = $residue; } echo "<br>"; process($residue,$new_year,$mon,$years_arr,$residue_arr); } else { print_r($years_arr); return $years_arr; } }//end of process(..)
Output for git.master, git.master_jit, rfc.property-hooks
<br>Array ( [0] => 2019 [1] => 2020 )

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