3v4l.org

run code in 500+ PHP versions simultaneously
<?php $_FILES = ["name" => ["aaa", "bbb"], "type" => ["png", "gif"]]; $keys = array_keys($_FILES); // get all the fields name $res = array_map(null, ...array_values($_FILES)); // group the array by each file $res = array_map(function ($e) use ($keys) {return array_combine($keys, $e);}, $res); // insert the field name to result array print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2FdGC
function name:  (null)
number of ops:  28
compiled vars:  !0 = $keys, !1 = $res
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                          global              $2      '_FILES'
          1        ASSIGN                                                       $2, <array>
    5     2        INIT_FCALL                                                   'array_keys'
          3        FETCH_R                          global              ~4      '_FILES'
          4        SEND_VAL                                                     ~4
          5        DO_ICALL                                             $5      
          6        ASSIGN                                                       !0, $5
    6     7        INIT_FCALL                                                   'array_map'
          8        SEND_VAL                                                     null
          9        INIT_FCALL                                                   'array_values'
         10        FETCH_R                          global              ~7      '_FILES'
         11        SEND_VAL                                                     ~7
         12        DO_ICALL                                             $8      
         13        SEND_UNPACK                                                  $8
         14        CHECK_UNDEF_ARGS                                             
         15        DO_ICALL                                             $9      
         16        ASSIGN                                                       !1, $9
    7    17        INIT_FCALL                                                   'array_map'
         18        DECLARE_LAMBDA_FUNCTION                              ~11     [0]
         19        BIND_LEXICAL                                                 ~11, !0
         20        SEND_VAL                                                     ~11
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                             $12     
         23        ASSIGN                                                       !1, $12
    9    24        INIT_FCALL                                                   'print_r'
         25        SEND_VAR                                                     !1
         26        DO_ICALL                                                     
         27      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2FdGC
function name:  {closure:/in/2FdGC:7}
number of ops:  8
compiled vars:  !0 = $e, !1 = $keys
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        INIT_FCALL                                                   'array_combine'
          3        SEND_VAR                                                     !1
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $2      
          6      > RETURN                                                       $2
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.23 ms | 2327 KiB | 18 Q