3v4l.org

run code in 300+ PHP versions simultaneously
<?php $alternatives = array( 'foo' => 0, 'foo1' => 0, 'foo3' => 0, ); echo 'before sorting:'.PHP_EOL; print_r($alternatives); asort($alternatives, SORT_STRING); echo 'after sorting:'.PHP_EOL; print_r($alternatives); $keys = array_keys($alternatives); print_r($keys); sort($keys); print_r($keys); sort($keys, SORT_STRING); print_r($keys); sort($keys, SORT_NATURAL); print_r($keys);

preferences:
50.42 ms | 402 KiB | 5 Q