3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [1,2, "2", 3, 1]; array_multisort($a, SORT_NUMERIC); var_dump($a); // $ar = array( // array("10", 11, 100, 100, "a"), // array( 1, 2, "2", 3, 1) // ); // array_multisort($ar[0], SORT_ASC, SORT_STRING, // $ar[1], SORT_NUMERIC, SORT_DESC); // var_dump($ar); ?>
based on idceZ
Output for 7.1.0 - 7.2.6
array(5) { [0]=> int(1) [1]=> int(1) [2]=> int(2) [3]=> string(1) "2" [4]=> int(3) }
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.0.20
array(5) { [0]=> int(1) [1]=> int(1) [2]=> string(1) "2" [3]=> int(2) [4]=> int(3) }