3v4l.org

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