3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startYear = 2014; $lastTaken = 2012; $recurrenceYears = 3; $nextRequirement = $lastTaken + ($recurrenceYears - (($lastTaken - $startYear) % $recurrenceYears)); echo $nextRequirement;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0nB6i
function name:  (null)
number of ops:  10
compiled vars:  !0 = $startYear, !1 = $lastTaken, !2 = $recurrenceYears, !3 = $nextRequirement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2014
    4     1        ASSIGN                                                   !1, 2012
    5     2        ASSIGN                                                   !2, 3
    8     3        SUB                                              ~7      !1, !0
          4        MOD                                              ~8      ~7, !2
          5        SUB                                              ~9      !2, ~8
          6        ADD                                              ~10     !1, ~9
          7        ASSIGN                                                   !3, ~10
   11     8        ECHO                                                     !3
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.55 ms | 1392 KiB | 13 Q