3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startYear = 2014; $currentYear = 2012; $lastTaken = 2012; $recurrenceYears = 3; $useYear = MAX($startYear-1, MIN($currentYear, $lastTaken)); $nextRequirement = $useYear + ($recurrenceYears - (($useYear - $startYear) % $recurrenceYears)); echo $nextRequirement;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h1AIG
function name:  (null)
number of ops:  21
compiled vars:  !0 = $startYear, !1 = $currentYear, !2 = $lastTaken, !3 = $recurrenceYears, !4 = $useYear, !5 = $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, 2012
    6     3        ASSIGN                                                   !3, 3
    8     4        INIT_FCALL                                               'max'
          5        SUB                                              ~10     !0, 1
          6        SEND_VAL                                                 ~10
          7        INIT_FCALL                                               'min'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $11     
         11        SEND_VAR                                                 $11
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !4, $12
   11    14        SUB                                              ~14     !4, !0
         15        MOD                                              ~15     ~14, !3
         16        SUB                                              ~16     !3, ~15
         17        ADD                                              ~17     !4, ~16
         18        ASSIGN                                                   !5, ~17
   13    19        ECHO                                                     !5
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149 ms | 1399 KiB | 17 Q