3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 5; $last = 4; foreach (range(-5, 4, 1) as $v) { 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 = 20
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/SdGLh
function name:  (null)
number of ops:  22
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, ->20
          8    > > FE_FETCH_R                                               $6, !2, ->20
    7     9    >   CONCAT                                           ~7      !2, '%3A+'
         10        MOD                                              ~8      !2, !0
         11        CONCAT                                           ~9      ~7, ~8
         12        CONCAT                                           ~10     ~9, '+'
         13        MOD                                              ~11     !2, !0
         14        ADD                                              ~12     ~11, !0
         15        MOD                                              ~13     ~12, !0
         16        CONCAT                                           ~14     ~10, ~13
         17        CONCAT                                           ~15     ~14, '%0A'
         18        ECHO                                                     ~15
    6    19      > JMP                                                      ->8
         20    >   FE_FREE                                                  $6
    8    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
203.41 ms | 1395 KiB | 15 Q