3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getAllCombinationsArray(){ $return = array(); $root = array( 1=>'cat1', 2=>'cat2', 3=>'cat3' ); $child_1 = array( 1=>'sub_cat1', 2=>'sub_cat2', 3=>'sub_cat3' ); $child_2 = array( 1=>'sub_sub_cat1', 2=>'sub_sub_cat2', 3=>'sub_sub_cat3' ); foreach($root as $fk => $fv){ foreach($child_1 as $ck => $cv){ $cid = $fk.'_'.$ck; $cname = $fv.' -> '.$cv; foreach($child_2 as $ck2 => $cv2){ $id = $cid.'_'.$ck2; $name = $cname.' -> '.$cv2; $return[$id] = $name; } } } return $return; } print_r(getAllCombinationsArray());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R15ZB
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'getallcombinationsarray'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function getallcombinationsarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 32
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 32
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 30
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 30
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 30
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/R15ZB
function name:  getAllCombinationsArray
number of ops:  35
compiled vars:  !0 = $return, !1 = $root, !2 = $child_1, !3 = $child_2, !4 = $fv, !5 = $fk, !6 = $cv, !7 = $ck, !8 = $cid, !9 = $cname, !10 = $cv2, !11 = $ck2, !12 = $id, !13 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, <array>
    8     3        ASSIGN                                                   !3, <array>
   10     4      > FE_RESET_R                                       $18     !1, ->32
          5    > > FE_FETCH_R                                       ~19     $18, !4, ->32
          6    >   ASSIGN                                                   !5, ~19
   11     7      > FE_RESET_R                                       $21     !2, ->30
          8    > > FE_FETCH_R                                       ~22     $21, !6, ->30
          9    >   ASSIGN                                                   !7, ~22
   12    10        CONCAT                                           ~24     !5, '_'
         11        CONCAT                                           ~25     ~24, !7
         12        ASSIGN                                                   !8, ~25
   13    13        CONCAT                                           ~27     !4, '+-%3E+'
         14        CONCAT                                           ~28     ~27, !6
         15        ASSIGN                                                   !9, ~28
   14    16      > FE_RESET_R                                       $30     !3, ->28
         17    > > FE_FETCH_R                                       ~31     $30, !10, ->28
         18    >   ASSIGN                                                   !11, ~31
   15    19        CONCAT                                           ~33     !8, '_'
         20        CONCAT                                           ~34     ~33, !11
         21        ASSIGN                                                   !12, ~34
   16    22        CONCAT                                           ~36     !9, '+-%3E+'
         23        CONCAT                                           ~37     ~36, !10
         24        ASSIGN                                                   !13, ~37
   17    25        ASSIGN_DIM                                               !0, !12
         26        OP_DATA                                                  !13
   14    27      > JMP                                                      ->17
         28    >   FE_FREE                                                  $30
   11    29      > JMP                                                      ->8
         30    >   FE_FREE                                                  $21
   10    31      > JMP                                                      ->5
         32    >   FE_FREE                                                  $18
   21    33      > RETURN                                                   !0
   22    34*     > RETURN                                                   null

End of function getallcombinationsarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.06 ms | 1403 KiB | 16 Q