3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = ['a', 'b', 'c', 'c', 'c', 'd', 'a', 'b', 'b', 'b', 'b']; $counts = array_count_values($array); arsort($counts); usort($array, fn($a, $b) => $counts[$b] <=> $counts[$a]); var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'b', 1 => 'b', 2 => 'b', 3 => 'b', 4 => 'b', 5 => 'c', 6 => 'c', 7 => 'c', 8 => 'a', 9 => 'a', 10 => 'd', )

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:
93.58 ms | 1293 KiB | 4 Q