3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $startYear = 2014; $currentYear = 2057; $lastTaken = 2014; $recurrenceYears = 3; $useYear = MIN($currentYear, $lastTaken); $nextYear = $useYear + ($recurrenceYears - (($useYear - $startYear) % $recurrenceYears)); echo $nextYear;
based on Dj0FE
Output for 4.3.0 - 7.1.0
2017