3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 0 => [ 'SMITH1', 'SMITH2', 'SMITH3', 'SMITH4', ], 1 =>[ 'JOHN1', 'JOHN2', 'JOHN3', 'JOHN4', ] ]; $newArr = []; foreach ($data[0] as $k=>$v){ $newArr[] = [ 'fname' => $v, 'lname' => $data[1][$k] ]; unset($data[0][$k]); unset($data[1][$k]); } array_multisort( array_column($newArr, 'fname'), SORT_ASC, array_column($newArr, 'lname'), SORT_ASC, $newArr ); print_r($newArr);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [fname] => SMITH1 [lname] => JOHN1 ) [1] => Array ( [fname] => SMITH2 [lname] => JOHN2 ) [2] => Array ( [fname] => SMITH3 [lname] => JOHN3 ) [3] => Array ( [fname] => SMITH4 [lname] => JOHN4 ) )

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