3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(876, 2, 23, 5); for ($i=0; $i<count($a); $i++) { for ($j=$i; $j<count($a); $j++) { if ($a[$i] < $a[$j]) { $tmp = $a[$i]; $a[$i] = $a[$j]; $a[$j] = $tmp; } } } var_dump($a);
Output for 4.3.0 - 7.1.0
array(4) { [0]=> int(876) [1]=> int(23) [2]=> int(5) [3]=> int(2) }