3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr2 = array ( 0 => array ( 0 => 'company-group', 1 => 'index', ), 1 => array ( 0 => 'company-group', 1 => 'view', ), 2 => array ( 0 => 'company-group', 1 => 'create', ), 3 => array ( 0 => 'company-group', 1 => 'update', ), 4 => array ( 0 => 'company-group', 1 => 'delete', ), 5 => array ( 0 => 'company-industry', 1 => 'index', ), 6 => array ( 0 => 'company-industry', 1 => 'view', ), 7 => array ( 0 => 'company-industry', 1 => 'create', ), 8 => array ( 0 => 'company-industry', 1 => 'update', ), 9 => array ( 0 => 'company-industry', 1 => 'delete', ), ); Foreach($arr2 as $sub){ $new[$sub[0]]["key"] = $sub[0]; $new[$sub[0]]["val"][] = $sub[1]; } Var_dump(array_values($new));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/HKM7S
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr2, !1 = $sub, !2 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   56     1      > FE_RESET_R                                       $4      !0, ->15
          2    > > FE_FETCH_R                                               $4, !1, ->15
   57     3    >   FETCH_DIM_R                                      ~5      !1, 0
          4        FETCH_DIM_R                                      ~8      !1, 0
          5        FETCH_DIM_W                                      $6      !2, ~5
          6        ASSIGN_DIM                                               $6, 'key'
          7        OP_DATA                                                  ~8
   58     8        FETCH_DIM_R                                      ~9      !1, 0
          9        FETCH_DIM_R                                      ~13     !1, 1
         10        FETCH_DIM_W                                      $10     !2, ~9
         11        FETCH_DIM_W                                      $11     $10, 'val'
         12        ASSIGN_DIM                                               $11
         13        OP_DATA                                                  ~13
   56    14      > JMP                                                      ->2
         15    >   FE_FREE                                                  $4
   61    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'array_values'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.84 ms | 1003 KiB | 15 Q