3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startYear = 2014; $currentYear = 2012; $lastTaken = 2012; $recurrenceYears = 3; $useYear = MAX($startYear, MIN($currentYear, $lastTaken)); $nextRequirement = $useYear + ($recurrenceYears - (($useYear - $startYear) % $recurrenceYears)); echo $nextRequirement;
based on SO667
Output for 4.3.0 - 7.2.0
2017