3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = ["a", "b", "c", "d", "e"]; $count = count($x); for ($i = 0, $limit = $count * 2; $i < $limit; ++$i) { echo $x[$i % $count] . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/Q3uqZ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $x, !1 = $count, !2 = $i, !3 = $limit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        COUNT                                            ~5      !0
          2        ASSIGN                                                   !1, ~5
    6     3        ASSIGN                                                   !2, 0
          4        MUL                                              ~8      !1, 2
          5        ASSIGN                                                   !3, ~8
          6      > JMP                                                      ->12
    7     7    >   MOD                                              ~10     !2, !1
          8        FETCH_DIM_R                                      ~11     !0, ~10
          9        CONCAT                                           ~12     ~11, '%0A'
         10        ECHO                                                     ~12
    6    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, !3
         13      > JMPNZ                                                    ~14, ->7
    8    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.98 ms | 1001 KiB | 13 Q