3v4l.org

run code in 150+ 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 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
2017
Output for hhvm-3.10.0

Process exited with code 153.