3v4l.org

run code in 300+ PHP versions simultaneously
<?php $limit = 13; $skip = 2; $keep = 3; $result = []; $array = range(1, 13); while ($array) { array_push( $result, ...array_slice( array_splice($array, 0, $skip + $keep), $skip ) ); } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
Branch analysis from position: 10
filename:       /in/IQvEr
function name:  (null)
number of ops:  30
compiled vars:  !0 = $limit, !1 = $skip, !2 = $keep, !3 = $result, !4 = $array
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        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 1
          6        SEND_VAL                                                 13
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !4, $9
    9     9      > JMP                                                      ->25
   10    10    >   INIT_FCALL                                               'array_push'
   11    11        SEND_REF                                                 !3
   12    12        INIT_FCALL                                               'array_slice'
   13    13        INIT_FCALL                                               'array_splice'
         14        SEND_REF                                                 !4
         15        SEND_VAL                                                 0
         16        ADD                                              ~11     !1, !2
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                         $12     
         19        SEND_VAR                                                 $12
   14    20        SEND_VAR                                                 !1
   12    21        DO_ICALL                                         $13     
   14    22        SEND_UNPACK                                              $13
         23        CHECK_UNDEF_ARGS                                         
   10    24        DO_ICALL                                                 
    9    25    > > JMPNZ                                                    !4, ->10
   18    26    >   INIT_FCALL                                               'var_export'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.35 ms | 1015 KiB | 18 Q