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);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [name] => aaa [type] => png ) [1] => Array ( [name] => bbb [type] => gif ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
19.16 ms | 401 KiB | 8 Q