3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function daycount($day, $startdate, $enddate, $counter) { if($startdate >= $enddate) { return $counter; } else { return daycount($day, strtotime("next ".$day, $startdate), ++$counter); } } echo daycount("monday", strtotime("18.01.2016"), 0);
based on Ttide
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function daycount(), 3 passed in /in/4RhM6 on line 15 and exactly 4 expected in /in/4RhM6:3 Stack trace: #0 /in/4RhM6(15): daycount('monday', 1453071600, 0) #1 {main} thrown in /in/4RhM6 on line 3
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Warning: Missing argument 4 for daycount(), called in /in/4RhM6 on line 15 and defined in /in/4RhM6 on line 3 Notice: Undefined variable: counter in /in/4RhM6 on line 7