3v4l.org

run code in 300+ PHP versions simultaneously
<?php function most_repeated_count($word) { $letters = str_split($word); return max(array_count_values($letters)); } $content = 'O Romeo, Romeo, wherefore art thou Romeo?'; $words = explode(' ', $content); $word_counts = array_combine( $words, array_map('most_repeated_count', $words) ); arsort($word_counts); $max = key($word_counts); echo $max;

preferences:
66.3 ms | 402 KiB | 5 Q