3v4l.org

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

Process exited with code 153.