3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array["1"] = "someval1"; $array["2"] = "someval2"; $array["3"] = "someval3"; $array["10"] = "someval4"; $array["100"] = "someval5"; $array["20"] = "someval6"; $array["200"] = "someval7"; $array["30"] = "someval8"; $array["300"] = "someval9"; var_dump($array); ksort($array, SORT_STRING); var_dump($array); ?>
based on Ffc8N
Output for 4.3.0 - 7.1.7, 7.2.0
array(9) { [1]=> string(8) "someval1" [2]=> string(8) "someval2" [3]=> string(8) "someval3" [10]=> string(8) "someval4" [100]=> string(8) "someval5" [20]=> string(8) "someval6" [200]=> string(8) "someval7" [30]=> string(8) "someval8" [300]=> string(8) "someval9" } array(9) { [1]=> string(8) "someval1" [10]=> string(8) "someval4" [100]=> string(8) "someval5" [2]=> string(8) "someval2" [20]=> string(8) "someval6" [200]=> string(8) "someval7" [3]=> string(8) "someval3" [30]=> string(8) "someval8" [300]=> string(8) "someval9" }
Output for 7.1.10

Process exited with code 137.