3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $alternatives = array( 'foo' => 0, 'foo1' => 0, 'foo3' => 0, ); asort($alternatives); print_r($alternatives); print_r(array_keys($alternatives));
based on CKDQK
Output for 7.0.0 - 7.2.0
Array ( [foo] => 0 [foo1] => 0 [foo3] => 0 ) Array ( [0] => foo [1] => foo1 [2] => foo3 )
Output for 5.3.18 - 5.6.28
Array ( [foo3] => 0 [foo1] => 0 [foo] => 0 ) Array ( [0] => foo3 [1] => foo1 [2] => foo )