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');
Output for 4.3.0 - 7.1.0