3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a=array("10", 2, 53, "2.5", "banana", "0"); $b = $a; $c = $b; sort($a); sort($b, SORT_NUMERIC); sort($c, SORT_STRING); var_dump($a); var_dump($b); var_dump($c);
Output for 4.3.0 - 7.1.0
array(6) { [0]=> string(1) "0" [1]=> int(2) [2]=> string(3) "2.5" [3]=> string(2) "10" [4]=> string(6) "banana" [5]=> int(53) } array(6) { [0]=> string(6) "banana" [1]=> string(1) "0" [2]=> int(2) [3]=> string(3) "2.5" [4]=> string(2) "10" [5]=> int(53) } array(6) { [0]=> string(1) "0" [1]=> string(2) "10" [2]=> int(2) [3]=> string(3) "2.5" [4]=> int(53) [5]=> string(6) "banana" }