3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = '0.3'; $b = '.5'; $c = '4'; $d = 'F'; $e = 'z'; $f = 4; $r1 = array($d, $e, $a, $f, $b, $c); $r2 = array($d, $e, $b, $f, $c, $a); sort($r1); sort($r2); var_dump($r1); var_dump($r2);
Output for 7.0.0 - 7.2.6
array(6) { [0]=> string(3) "0.3" [1]=> string(2) ".5" [2]=> string(1) "F" [3]=> string(1) "z" [4]=> int(4) [5]=> string(1) "4" } array(6) { [0]=> string(3) "0.3" [1]=> string(2) ".5" [2]=> string(1) "F" [3]=> string(1) "z" [4]=> int(4) [5]=> string(1) "4" }
Output for 4.3.0 - 5.0.0, 5.0.2 - 5.6.28
array(6) { [0]=> string(3) "0.3" [1]=> string(2) ".5" [2]=> string(1) "4" [3]=> string(1) "F" [4]=> string(1) "z" [5]=> int(4) } array(6) { [0]=> string(3) "0.3" [1]=> string(2) ".5" [2]=> string(1) "F" [3]=> string(1) "z" [4]=> int(4) [5]=> string(1) "4" }
Output for 5.0.1
array(6) { [0]=> string(2) ".5" [1]=> string(3) "0.3" [2]=> string(1) "4" [3]=> string(1) "F" [4]=> string(1) "z" [5]=> int(4) } array(6) { [0]=> string(2) ".5" [1]=> string(3) "0.3" [2]=> string(1) "F" [3]=> string(1) "z" [4]=> int(4) [5]=> string(1) "4" }