3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array ( 'name' => array ( 0 => 'test1', 1 => 'test2' ), 'type' => array ( 0 => 'image/jpeg', 1 => 'image/jpeg' ), 'tmp_name' => array ( 0 => 'D:\xampp5\tmp\php5F43.tmp', 1 => 'D:\xampp5\tmp\php5F63.tmp' ), 'error' => array ( 0 => 0, 1 => 0 ), 'size' => array ( 0 => 49293, 1 => 20286 ) ); $result = array(); foreach (array_keys(current($array)) as $key) { $result[$key] = array_combine(array_keys($array), array_column($array, $key)); } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 24
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/tZOq3
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $result, !2 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   30     1        ASSIGN                                                       !1, <array>
   31     2        INIT_FCALL                                                   'array_keys'
          3        INIT_FCALL                                                   'current'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $5      
          6        SEND_VAR                                                     $5
          7        DO_ICALL                                             $6      
          8      > FE_RESET_R                                           $7      $6, ->24
          9    > > FE_FETCH_R                                                   $7, !2, ->24
   32    10    >   INIT_FCALL                                                   'array_combine'
         11        INIT_FCALL                                                   'array_keys'
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                             $9      
         14        SEND_VAR                                                     $9
         15        INIT_FCALL                                                   'array_column'
         16        SEND_VAR                                                     !0
         17        SEND_VAR                                                     !2
         18        DO_ICALL                                             $10     
         19        SEND_VAR                                                     $10
         20        DO_ICALL                                             $11     
         21        ASSIGN_DIM                                                   !1, !2
         22        OP_DATA                                                      $11
   31    23      > JMP                                                          ->9
         24    >   FE_FREE                                                      $7
   34    25        INIT_FCALL                                                   'print_r'
         26        SEND_VAR                                                     !1
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.87 ms | 2204 KiB | 17 Q