3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a=array("10", 2, 53, "2.5", "banana"); $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 hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> int(2) [1]=> string(3) "2.5" [2]=> string(2) "10" [3]=> string(6) "banana" [4]=> int(53) } array(5) { [0]=> string(6) "banana" [1]=> int(2) [2]=> string(3) "2.5" [3]=> string(2) "10" [4]=> int(53) } array(5) { [0]=> string(2) "10" [1]=> int(2) [2]=> string(3) "2.5" [3]=> int(53) [4]=> string(6) "banana" }
Output for 4.3.0 - 5.6.28
array(5) { [0]=> string(6) "banana" [1]=> int(2) [2]=> string(3) "2.5" [3]=> string(2) "10" [4]=> int(53) } array(5) { [0]=> string(6) "banana" [1]=> int(2) [2]=> string(3) "2.5" [3]=> string(2) "10" [4]=> int(53) } array(5) { [0]=> string(2) "10" [1]=> int(2) [2]=> string(3) "2.5" [3]=> int(53) [4]=> string(6) "banana" }