3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $word = "Stefane ides u kurac stefane pusis kurac samo kurac da da da!"; $split = explode(" ", strtolower($word)); $map = array(); foreach ($split as $v) { if (isset($map[$v])) { $map[$v]++; } else { $map[$v] = 1; } } asort($map); print_r($map);
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [ides] => 1 [u] => 1 [pusis] => 1 [samo] => 1 [da!] => 1 [stefane] => 2 [da] => 2 [kurac] => 3 )
Output for 4.3.0 - 5.6.28
Array ( [pusis] => 1 [samo] => 1 [da!] => 1 [u] => 1 [ides] => 1 [da] => 2 [stefane] => 2 [kurac] => 3 )