3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 'EVENTNAME' => array ( 0 => 'Brexit', 1 => 'leave date set', 2 => 'leave date ', 3 => 'deal or no deal', ), 'IMMIGRATIONS' => array ( 0 => '1', 1 => '1', 2 => '1', 3 => '1', ), 'EFFECTS' => array ( 0 => '2', 1 => '1', 2 => '1', 3 => '2', ), 'SUPPLYCHAINS' => array ( 0 => '1', 1 => '1', 2 => '1', 3 => '1', ), ); $keys = array_keys($arr); foreach($arr[$keys[0]] as $key => $val){ $result[$val] = array_column(array_slice($arr,1), $key); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/Seteg
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $keys, !2 = $val, !3 = $key, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    6     5        FETCH_DIM_R                                      ~8      !1, 0
          6        FETCH_DIM_R                                      ~9      !0, ~8
          7      > FE_RESET_R                                       $10     ~9, ->21
          8    > > FE_FETCH_R                                       ~11     $10, !2, ->21
          9    >   ASSIGN                                                   !3, ~11
    7    10        INIT_FCALL                                               'array_column'
         11        INIT_FCALL                                               'array_slice'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $14     
         15        SEND_VAR                                                 $14
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $15     
         18        ASSIGN_DIM                                               !4, !2
         19        OP_DATA                                                  $15
    6    20      > JMP                                                      ->8
         21    >   FE_FREE                                                  $10
   10    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.62 ms | 1440 KiB | 17 Q