3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function sortByLength($a, $b) { $lenA = strlen($a); $lenB = strlen($b); if ($lenA == $lenB) { return 0; } return $lenA < $lenB ? -1 : 1; } $values = array( 'ccc', 'a', 'eeeeee', 'dddd', 'bb', 'fffff' ); usort($values, 'sortByLength'); echo $values[5];
Output for 4.3.0 - 7.1.0
eeeeee