3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $strings = array('SS2014', 'SU2014','FW2014','SS2013','SU2013','FW2013'); $results = array(); sort($strings); echo 'using normal sort'; var_dump($strings); ksort($strings); echo 'using ksort'; var_dump($strings); natsort($strings); echo 'using ntsort'; var_dump($strings);
Output for 4.3.0 - 7.1.0
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ntsortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" }