3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $v = [ 'aaaa', 'bbbb', 'ccccccc', 'dddddddddd', 'eeeeeeee', 'ffffffffffff', 'gggg', 'hhhhhh', 'iiiiiiiiiii', 'lllllll', 'mmmmmmmmmmm', 'nnnnnnn', 'ooo', ]; usort($v, function($a, $b){ return mb_strlen($b) <=> mb_strlen($a); }); var_dump($v);
based on 4KBq7
Output for 7.0.0 - 7.3.0beta1
array(13) { [0]=> string(12) "ffffffffffff" [1]=> string(11) "iiiiiiiiiii" [2]=> string(11) "mmmmmmmmmmm" [3]=> string(10) "dddddddddd" [4]=> string(8) "eeeeeeee" [5]=> string(7) "ccccccc" [6]=> string(7) "lllllll" [7]=> string(7) "nnnnnnn" [8]=> string(6) "hhhhhh" [9]=> string(4) "aaaa" [10]=> string(4) "bbbb" [11]=> string(4) "gggg" [12]=> string(3) "ooo" }
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected '>' in /in/da83s on line 20
Process exited with code 255.