3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { return strcmp($a, $b); } $fruits = array(5,1,9,7,4); usort($fruits, "cmp"); echo '<pre>'; print_r($fruits); echo '</pre>';
based on svPm2
Output for 4.3.0 - 7.1.0
<pre>Array ( [0] => 1 [1] => 4 [2] => 5 [3] => 7 [4] => 9 ) </pre>