3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { return ($a < $b) ? -1 : 1; } $array = ["tarologue", "tarologue", "voyants", "voyants", "medium", "medium", "medium", "astrologue"]; usort($array, "cmp"); var_dump($array);
based on LvLV4
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0rc3
array(8) { [0]=> string(10) "astrologue" [1]=> string(6) "medium" [2]=> string(6) "medium" [3]=> string(6) "medium" [4]=> string(9) "tarologue" [5]=> string(9) "tarologue" [6]=> string(7) "voyants" [7]=> string(7) "voyants" }