3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sizes = array("L", "XXXL", "M", "S", "O","Z"); function compare($a, $b) { $sizeincrement = array("XS", "S", "M", "L", "XL", "XXL", "XXXL"); return array_search($a, $sizeincrement) > array_search($b, $sizeincrement); } usort($sizes, "compare"); print_r($sizes);
Output for 4.3.0 - 7.1.0
Array ( [0] => O [1] => Z [2] => S [3] => M [4] => L [5] => XXXL )