3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( '0' => Array ( 'pa_flavour' => 101 ), '1' => Array ( 'pa_flavour' => 102 ), '2' => Array ( 'pa_flavour' => 103 ), '3' => Array ( 'pa_flavour' => 104 ), '4' => Array ( 'pa_flavour' => 100 ), '5' => Array ( 'pa_bottle-size' => 108 ), '6' => Array ( 'pa_nicotine-strength' => 109 ), '7' => Array ( 'pa_nicotine-strength' => 110 ) ); $res = []; foreach($arr as $k => $v){ foreach ($v as $key => $value) { $res[$key][] = $value; } } print_r($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/1ZoT2
function name:  (null)
number of ops:  19
compiled vars:  !0 = $arr, !1 = $res, !2 = $v, !3 = $k, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   46     1        ASSIGN                                                   !1, <array>
   47     2      > FE_RESET_R                                       $8      !0, ->14
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->14
          4    >   ASSIGN                                                   !3, ~9
   48     5      > FE_RESET_R                                       $11     !2, ->12
          6    > > FE_FETCH_R                                       ~12     $11, !4, ->12
          7    >   ASSIGN                                                   !5, ~12
   49     8        FETCH_DIM_W                                      $14     !1, !5
          9        ASSIGN_DIM                                               $14
         10        OP_DATA                                                  !4
   48    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $11
   47    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $8
   52    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.96 ms | 1013 KiB | 14 Q