3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('apple','banana','apple','orange','grape','orange', 'mango'); $fruits = array_count_values($array); foreach ($fruits as $key => $val) { $arr[$key] = $val; } asort($arr); foreach ($arr as $key => $val) { $fruit[$key] = $val; } arsort($fruit); var_dump($fruit);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { ["apple"]=> int(2) ["orange"]=> int(2) ["banana"]=> int(1) ["grape"]=> int(1) ["mango"]=> int(1) }

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