3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.07 ms | 1393 KiB | 13 Q