3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["Post1" => "Platinum", "Post2" => "Bronze", "Post3" => "Gold", "Post4" => "Uncomplete", "Post5" => "Gold"]; $order = array_flip(["Platinum", "Gold", "Silver", "Bronze", "Complete", "None", "Uncomplete"]); // makes: array ('Platinum' => 0, 'Gold' => 1, 'Silver' => 2, 'Bronze' => 3, 'Complete' => 4, 'None' => 5, 'Uncomplete' => 6) uasort($array, function ($a, $b) use ($order) { return $order[$a] <=> $order[$b]; }); var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'Post1' => 'Platinum', 'Post3' => 'Gold', 'Post5' => 'Gold', 'Post2' => 'Bronze', 'Post4' => 'Uncomplete', )

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