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 ? 0 : 1; } $values = array( 'ccc', 'a', 'eeeeee', 'dddd', 'bb', 'fffff' ); usort($values, 'sortByLength'); echo $values[5];
Output for 4.3.0 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
a