3v4l.org

run code in 300+ PHP versions simultaneously
<?php function slice_recursive(array $array, int $skip, int $keep) { if (!$array) { return $array; } return array_merge( array_slice( array_splice($array, 0, $skip + $keep), $skip ), slice_recursive($array, $skip, $keep) ); } var_export( slice_recursive(range(1, 13), 2, 3) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7P41g
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_export'
   18     1        INIT_FCALL                                               'slice_recursive'
          2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 13
          5        DO_ICALL                                         $0      
          6        SEND_VAR                                                 $0
          7        SEND_VAL                                                 2
          8        SEND_VAL                                                 3
          9        DO_FCALL                                      0  $1      
         10        SEND_VAR                                                 $1
   17    11        DO_ICALL                                                 
   19    12      > RETURN                                                   1

Function slice_recursive:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7P41g
function name:  slice_recursive
number of ops:  27
compiled vars:  !0 = $array, !1 = $skip, !2 = $keep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        BOOL_NOT                                         ~3      !0
          4      > JMPZ                                                     ~3, ->6
    6     5    > > RETURN                                                   !0
    8     6    >   INIT_FCALL                                               'array_merge'
    9     7        INIT_FCALL                                               'array_slice'
   10     8        INIT_FCALL                                               'array_splice'
          9        SEND_REF                                                 !0
         10        SEND_VAL                                                 0
         11        ADD                                              ~4      !1, !2
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
   11    15        SEND_VAR                                                 !1
    9    16        DO_ICALL                                         $6      
   11    17        SEND_VAR                                                 $6
   13    18        INIT_FCALL_BY_NAME                                       'slice_recursive'
         19        SEND_VAR_EX                                              !0
         20        SEND_VAR_EX                                              !1
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $7      
         23        SEND_VAR                                                 $7
    8    24        DO_ICALL                                         $8      
   13    25      > RETURN                                                   $8
   15    26*     > RETURN                                                   null

End of function slice_recursive

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.42 ms | 1022 KiB | 19 Q