3v4l.org

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