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));
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [37] => Array ( [name] => my-file-test.docx [type] => application/vnd.openxmlformats-officedocument.wordprocessingml.document [tmp_name] => /tmp/phpahucFZ [error] => 0 [size] => 12023 ) [38] => Array ( [name] => resources_views.php [type] => application/x-php [tmp_name] => /tmp/phptnDGQR [error] => 0 [size] => 18174 ) ) Array ( [0] => Array ( [name] => my-file-test.docx [type] => application/vnd.openxmlformats-officedocument.wordprocessingml.document [tmp_name] => /tmp/phpahucFZ [error] => 0 [size] => 12023 ) [1] => Array ( [name] => resources_views.php [type] => application/x-php [tmp_name] => /tmp/phptnDGQR [error] => 0 [size] => 18174 ) )

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:
112.63 ms | 408 KiB | 5 Q