3v4l.org

run code in 300+ PHP versions simultaneously
<?php $limit = 13; $skip = 2; $keep = 3; $result = []; for ( $x = 1 + $skip, $k = 1; $x <= $limit; $x += ($k++ % $keep ? 1 : 1 + $skip) ) { $result[] = $x; } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 8
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 8
Branch analysis from position: 20
Branch analysis from position: 8
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 8
Branch analysis from position: 20
Branch analysis from position: 8
filename:       /in/nFvQT
function name:  (null)
number of ops:  24
compiled vars:  !0 = $limit, !1 = $skip, !2 = $keep, !3 = $result, !4 = $x, !5 = $k
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        ADD                                              ~10     1, !1
          5        ASSIGN                                                   !4, ~10
          6        ASSIGN                                                   !5, 1
          7      > JMP                                                      ->18
   12     8    >   ASSIGN_DIM                                               !3
          9        OP_DATA                                                  !4
   10    10        POST_INC                                         ~14     !5
         11        MOD                                              ~15     ~14, !2
         12      > JMPZ                                                     ~15, ->15
         13    >   QM_ASSIGN                                        ~16     1
         14      > JMP                                                      ->17
         15    >   ADD                                              ~17     1, !1
         16        QM_ASSIGN                                        ~16     ~17
         17    >   ASSIGN_OP                                     1          !4, ~16
    9    18    >   IS_SMALLER_OR_EQUAL                                      !4, !0
         19      > JMPNZ                                                    ~19, ->8
   14    20    >   INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.56 ms | 1011 KiB | 14 Q