3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "entry" => [ "name" => [ 37 => [ "file" => "my-file-test.docx", ], 38 => [ "file" => "resources_views.php", ], ], "type" => [ 37 => [ "file" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", ], 38 => [ "file" => "application/x-php", ], ], "tmp_name" => [ 37 => [ "file" => "/tmp/phpahucFZ", ], 38 => [ "file" => "/tmp/phptnDGQR", ], ], "error" => [ 37 => [ "file" => 0, ], 38 => [ "file" => 0, ], ], "size" => [ 37 => [ "file" => 12023, ], 38 => [ "file" => 18174, ], ], ], ]; $result = []; foreach ($arr['entry'] as $key => $value) { foreach ($value as $key1 => $value1) { $result[$key1][$key] = $value1['file']; } } print_r($result); //reset index demo print_r(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/US9OQ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $result, !2 = $value, !3 = $key, !4 = $value1, !5 = $key1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   63     1        ASSIGN                                                   !1, <array>
   64     2        FETCH_DIM_R                                      ~8      !0, 'entry'
          3      > FE_RESET_R                                       $9      ~8, ->16
          4    > > FE_FETCH_R                                       ~10     $9, !2, ->16
          5    >   ASSIGN                                                   !3, ~10
   65     6      > FE_RESET_R                                       $12     !2, ->14
          7    > > FE_FETCH_R                                       ~13     $12, !4, ->14
          8    >   ASSIGN                                                   !5, ~13
   66     9        FETCH_DIM_R                                      ~17     !4, 'file'
         10        FETCH_DIM_W                                      $15     !1, !5
         11        ASSIGN_DIM                                               $15, !3
         12        OP_DATA                                                  ~17
   65    13      > JMP                                                      ->7
         14    >   FE_FREE                                                  $12
   64    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $9
   69    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   73    20        INIT_FCALL                                               'print_r'
         21        INIT_FCALL                                               'array_values'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $19     
         24        SEND_VAR                                                 $19
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.01 ms | 1007 KiB | 15 Q