3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "hrid" => 1, "masterroom" => "B4-G-3" ], [ "hrid" => 2, "masterroom" => "B4-G-1" ], [ "hrid" => 7, "masterroom" => "B4-1-2" ], [ "hrid" => 8, "masterroom" => "B4-1-1" ], [ "hrid" => 9, "masterroom" => "B4-1-10" ], [ "hrid" => 10, "masterroom" => "B4-G-10" ] ]; // Pre 5.5 foreach($array as $key => $value) { $hrid[$key] = $value['hrid']; $masterrom[$key] = $value['masterroom']; } // 5.5+ // $masterroom = array_column($array, 'masterroom'); // $hrid = array_column($array, 'hrid'); array_multisort($masterroom, SORT_NATURAL, $hrid, SORT_ASC, $array); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag in /in/Bc88G:39 Stack trace: #0 /in/Bc88G(39): array_multisort(NULL, 6, Array, 4, Array) #1 {main} thrown in /in/Bc88G on line 39
Process exited with code 255.

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:
173.23 ms | 405 KiB | 5 Q