3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['App', 'Classes', 'Auth'], ['App', 'Classes', 'Auth'], ['App', 'Classes', 'Middleware'], ['App', 'Classes', 'Phone'], ['App', 'Classes', 'Auth'], ['App', 'Mail'], ['App', 'Mail', 'Sender'], ['App', 'Box'], ]; $hierarchy = []; foreach($array as $each_data){ $curr_hierarchy = &$hierarchy; foreach($each_data as $each_namespace){ if(!isset($curr_hierarchy[$each_namespace])){ $curr_hierarchy[$each_namespace] = []; } $curr_hierarchy = &$curr_hierarchy[$each_namespace]; } } print_r($hierarchy);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/AVVZI
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $hierarchy, !2 = $each_data, !3 = $curr_hierarchy, !4 = $each_namespace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $7      !0, ->17
          3    > > FE_FETCH_R                                               $7, !2, ->17
   17     4    >   ASSIGN_REF                                               !3, !1
   18     5      > FE_RESET_R                                       $9      !2, ->15
          6    > > FE_FETCH_R                                               $9, !4, ->15
   19     7    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !3, !4
          8        BOOL_NOT                                         ~11     ~10
          9      > JMPZ                                                     ~11, ->12
   20    10    >   ASSIGN_DIM                                               !3, !4
         11        OP_DATA                                                  <array>
   23    12    >   FETCH_DIM_W                                      $13     !3, !4
         13        ASSIGN_REF                                               !3, $13
   18    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $9
   16    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $7
   27    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.34 ms | 1396 KiB | 15 Q