3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Fonction de comparaison function cmp($a, $b) { return 0; } // Tableau à trier $array = array('a' => 4, 'b' => 8, 'c' => -1, 'd' => -9, 'e' => 2, 'f' => 5, 'g' => 3, 'h' => -4); // Trie et affiche le tableau résultant uasort($array, 'cmp'); print_r($array);
based on fYTIO
Output for hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0rc3
Array ( [a] => 4 [b] => 8 [c] => -1 [d] => -9 [e] => 2 [f] => 5 [g] => 3 [h] => -4 )
Output for 5.6.0 - 5.6.30
Array ( [f] => 5 [g] => 3 [h] => -4 [e] => 2 [d] => -9 [b] => 8 [c] => -1 [a] => 4 )