3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'a b c d a c a d 你 我 他们 我'; $a = explode(' ', $str); var_dump(array_count_values($a));
based on 5GIom
Output for 4.3.0 - 7.2.0
array(7) { ["a"]=> int(3) ["b"]=> int(1) ["c"]=> int(2) ["d"]=> int(2) ["你"]=> int(1) ["我"]=> int(2) ["他们"]=> int(1) }