3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cars = array('volvo', 'benz','honda','volvo','toyota', 'toyota'); $counts = array_count_values($cars); var_dump(array_keys($counts, max($counts)));
Output for 7.0.0 - 7.0.24, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
array(2) { [0]=> string(5) "volvo" [1]=> string(6) "toyota" }

preferences:
156.61 ms | 408 KiB | 5 Q