3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array("A","BC","AA","C","BB", "B"); function lensort($a,$b){ $la = strlen( $a); $lb = strlen( $b); if( $la == $lb) { return strcmp( $a, $b); } return $la - $lb; } usort($array,'lensort'); print_r( $array);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [0] => A [1] => B [2] => C [3] => AA [4] => BB [5] => BC )
Output for hhvm-3.10.0

Process exited with code 153.