3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [6,3,9], [9,1,6], [4,7,9] ]; echo "input array: "; print_r($input); $sort_keys = $input[0]; asort($sort_keys); $sorted = array_map(function($row) use ($sort_keys){ foreach ($sort_keys as $key => $value) { $result[] = $row[$key]; } return $result; }, $input); echo "sorted array: "; print_r($sorted);
Output for git.master, git.master_jit, rfc.property-hooks
input array: Array ( [0] => Array ( [0] => 6 [1] => 3 [2] => 9 ) [1] => Array ( [0] => 9 [1] => 1 [2] => 6 ) [2] => Array ( [0] => 4 [1] => 7 [2] => 9 ) ) sorted array: Array ( [0] => Array ( [0] => 3 [1] => 6 [2] => 9 ) [1] => Array ( [0] => 1 [1] => 9 [2] => 6 ) [2] => Array ( [0] => 7 [1] => 4 [2] => 9 ) )

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:
59.71 ms | 402 KiB | 8 Q