3v4l.org

run code in 300+ PHP versions simultaneously
<?php $limit = 13; $skip = 2; $keep = 3; $result = []; for ($x = 1; $x <= $limit; ++$x) { if (($x - 1) % ($skip + $keep) < $skip) { continue; } $result[] = $x; } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
filename:       /in/IAqm3
function name:  (null)
number of ops:  21
compiled vars:  !0 = $limit, !1 = $skip, !2 = $keep, !3 = $result, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 13
    4     1        ASSIGN                                                   !1, 2
    5     2        ASSIGN                                                   !2, 3
    6     3        ASSIGN                                                   !3, <array>
    8     4        ASSIGN                                                   !4, 1
          5      > JMP                                                      ->15
    9     6    >   SUB                                              ~10     !4, 1
          7        ADD                                              ~11     !1, !2
          8        MOD                                              ~12     ~10, ~11
          9        IS_SMALLER                                               ~12, !1
         10      > JMPZ                                                     ~13, ->12
   10    11    > > JMP                                                      ->14
   12    12    >   ASSIGN_DIM                                               !3
         13        OP_DATA                                                  !4
    8    14    >   PRE_INC                                                  !4
         15    >   IS_SMALLER_OR_EQUAL                                      !4, !0
         16      > JMPNZ                                                    ~16, ->6
   14    17    >   INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.65 ms | 1010 KiB | 14 Q