3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "channels" => [ "0" => [ "position" => 5, "id" => 11, "name" => "AFK", ], "1" => [ "position" => 1, "id" => 22, "name" => "ARK", ], "2" => [ "position" => 2, "id" => 33, "name" => "ESO", ], "3" => [ "position" => 4, "id" => 44, "name" => "semi-afk", ], "4" => [ "position" => 0, "id" => 55, "name" => "SPACE", ], "5" => [ "position" => 3, "id" => 66, "name" => "Tanks & Ships", ], ] ]; usort($array['channels'], function($a, $b) { return $a['position'] > $b['position'] ? 1 : -1; }); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [channels] => Array ( [0] => Array ( [position] => 0 [id] => 55 [name] => SPACE ) [1] => Array ( [position] => 1 [id] => 22 [name] => ARK ) [2] => Array ( [position] => 2 [id] => 33 [name] => ESO ) [3] => Array ( [position] => 3 [id] => 66 [name] => Tanks & Ships ) [4] => Array ( [position] => 4 [id] => 44 [name] => semi-afk ) [5] => Array ( [position] => 5 [id] => 11 [name] => AFK ) ) )

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:
189.51 ms | 409 KiB | 5 Q