3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(5, "43", 2, "10"); asort($a); var_dump($a); asort($a, SORT_NUMERIC); var_dump($a); asort($a, SORT_STRING); var_dump($a);
based on fX7g0
Output for 4.3.0 - 7.2.0
array(4) { [2]=> int(2) [0]=> int(5) [3]=> string(2) "10" [1]=> string(2) "43" } array(4) { [2]=> int(2) [0]=> int(5) [3]=> string(2) "10" [1]=> string(2) "43" } array(4) { [3]=> string(2) "10" [2]=> int(2) [1]=> string(2) "43" [0]=> int(5) }