3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a', 'b', 'c'); function depth_picker($arr, $temp_string, &$collect) { if ($temp_string != "") $collect []= $temp_string; for ($i=0; $i<sizeof($arr);$i++) { $arrcopy = $arr; $elem = array_splice($arrcopy, $i, 1); // removes and returns the i'th element if (sizeof($arrcopy) > 0) { depth_picker($arrcopy, $temp_string ." " . $elem[0], $collect); } else { $collect []= $temp_string. " " . $elem[0]; } } } $collect = array(); depth_picker($array, "", $collect); print_r($collect);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9G5c9
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $collect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        ASSIGN                                                   !1, <array>
   21     2        INIT_FCALL                                               'depth_picker'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 ''
          5        SEND_REF                                                 !1
          6        DO_FCALL                                      0          
   22     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function depth_picker:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 9
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 9
Branch analysis from position: 37
Branch analysis from position: 9
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 9
Branch analysis from position: 37
Branch analysis from position: 9
Branch analysis from position: 7
filename:       /in/9G5c9
function name:  depth_picker
number of ops:  38
compiled vars:  !0 = $arr, !1 = $temp_string, !2 = $collect, !3 = $i, !4 = $arrcopy, !5 = $elem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    6     3        IS_NOT_EQUAL                                             !1, ''
          4      > JMPZ                                                     ~6, ->7
    7     5    >   ASSIGN_DIM                                               !2
          6        OP_DATA                                                  !1
    9     7    >   ASSIGN                                                   !3, 0
          8      > JMP                                                      ->34
   10     9    >   ASSIGN                                                   !4, !0
   11    10        INIT_FCALL                                               'array_splice'
         11        SEND_REF                                                 !4
         12        SEND_VAR                                                 !3
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !5, $10
   12    16        COUNT                                            ~12     !4
         17        IS_SMALLER                                               0, ~12
         18      > JMPZ                                                     ~13, ->28
   13    19    >   INIT_FCALL_BY_NAME                                       'depth_picker'
         20        SEND_VAR_EX                                              !4
         21        CONCAT                                           ~14     !1, '+'
         22        FETCH_DIM_R                                      ~15     !5, 0
         23        CONCAT                                           ~16     ~14, ~15
         24        SEND_VAL_EX                                              ~16
         25        SEND_VAR_EX                                              !2
         26        DO_FCALL                                      0          
         27      > JMP                                                      ->33
   15    28    >   CONCAT                                           ~19     !1, '+'
         29        FETCH_DIM_R                                      ~20     !5, 0
         30        CONCAT                                           ~21     ~19, ~20
         31        ASSIGN_DIM                                               !2
         32        OP_DATA                                                  ~21
    9    33    >   PRE_INC                                                  !3
         34    >   COUNT                                            ~23     !0
         35        IS_SMALLER                                               !3, ~23
         36      > JMPNZ                                                    ~24, ->9
   18    37    > > RETURN                                                   null

End of function depth_picker

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.65 ms | 1394 KiB | 18 Q