3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 5; $last = 4; foreach (range(-5, 4, 1) as $v) { if ($v < 0) { print $v . ': ' .$v % $count . ' ' . ((($v % $count) + $count) % $count + 1) . "\n"; } else { print $v . ': ' .$v % $count . ' ' . (($v % $count) + $count) % $count . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 34
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 34
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/UMQVu
function name:  (null)
number of ops:  36
compiled vars:  !0 = $count, !1 = $last, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        ASSIGN                                                   !1, 4
    6     2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 -5
          4        SEND_VAL                                                 4
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $5      
          7      > FE_RESET_R                                       $6      $5, ->34
          8    > > FE_FETCH_R                                               $6, !2, ->34
    8     9    >   IS_SMALLER                                               !2, 0
         10      > JMPZ                                                     ~7, ->23
    9    11    >   CONCAT                                           ~8      !2, '%3A+'
         12        MOD                                              ~9      !2, !0
         13        CONCAT                                           ~10     ~8, ~9
         14        CONCAT                                           ~11     ~10, '+'
         15        MOD                                              ~12     !2, !0
         16        ADD                                              ~13     ~12, !0
         17        MOD                                              ~14     ~13, !0
         18        ADD                                              ~15     ~14, 1
         19        CONCAT                                           ~16     ~11, ~15
         20        CONCAT                                           ~17     ~16, '%0A'
         21        ECHO                                                     ~17
         22      > JMP                                                      ->33
   11    23    >   CONCAT                                           ~18     !2, '%3A+'
         24        MOD                                              ~19     !2, !0
         25        CONCAT                                           ~20     ~18, ~19
         26        CONCAT                                           ~21     ~20, '+'
         27        MOD                                              ~22     !2, !0
         28        ADD                                              ~23     ~22, !0
         29        MOD                                              ~24     ~23, !0
         30        CONCAT                                           ~25     ~21, ~24
         31        CONCAT                                           ~26     ~25, '%0A'
         32        ECHO                                                     ~26
    6    33    > > JMP                                                      ->8
         34    >   FE_FREE                                                  $6
   13    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.55 ms | 1396 KiB | 15 Q