3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.88 ms | 1392 KiB | 13 Q