3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startYear = 2014; $modYear = 3; $lastTaken = 2017; $currentYear = 2021; $useYear = min($lastTaken, $currentYear); $nextYear = $useYear + ($modYear - (($useYear - $startYear) % $modYear)); echo $nextYear;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qGLjU
function name:  (null)
number of ops:  16
compiled vars:  !0 = $startYear, !1 = $modYear, !2 = $lastTaken, !3 = $currentYear, !4 = $useYear, !5 = $nextYear
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2014
    4     1        ASSIGN                                                   !1, 3
    5     2        ASSIGN                                                   !2, 2017
    6     3        ASSIGN                                                   !3, 2021
    8     4        INIT_FCALL                                               'min'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !3
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !4, $10
   10     9        SUB                                              ~12     !4, !0
         10        MOD                                              ~13     ~12, !1
         11        SUB                                              ~14     !1, ~13
         12        ADD                                              ~15     !4, ~14
         13        ASSIGN                                                   !5, ~15
   12    14        ECHO                                                     !5
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.1 ms | 1385 KiB | 15 Q