3v4l.org

run code in 300+ 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);

preferences:
14.82 ms | 402 KiB | 5 Q