3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name_arr = array('raj','raj','ganesh','rahul','ganesh','mayur','raj','rahul'); $valueCount = array_count_values($name_arr); $final_arr = $name_arr; usort($final_arr, function ($a, $b) use ($valueCount) { return $valueCount[$b] - $valueCount[$a]; }); var_dump($final_arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(8) { [0]=> string(3) "raj" [1]=> string(3) "raj" [2]=> string(3) "raj" [3]=> string(6) "ganesh" [4]=> string(5) "rahul" [5]=> string(6) "ganesh" [6]=> string(5) "rahul" [7]=> string(5) "mayur" }

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:
56.13 ms | 401 KiB | 8 Q