3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startYear = 2014; $currentYear = 2012; $lastTaken = 2012; $recurrenceYears = 3; $useYear = MAX($startYear, 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/4HX0g
function name:  (null)
number of ops:  20
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        SEND_VAR                                                 !0
          6        INIT_FCALL                                               'min'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $10     
         10        SEND_VAR                                                 $10
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !4, $11
   11    13        SUB                                              ~13     !4, !0
         14        MOD                                              ~14     ~13, !3
         15        SUB                                              ~15     !3, ~14
         16        ADD                                              ~16     !4, ~15
         17        ASSIGN                                                   !5, ~16
   13    18        ECHO                                                     !5
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.39 ms | 1395 KiB | 17 Q