3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = range(0, 100); shuffle($arr); $size = count($arr)-1; for ($i = $size; $i>=0; $i--) { for ($j = 0; $j<=($i-1); $j++) if ($arr[$j]>$arr[$j+1]) { $k = $arr[$j]; $arr[$j] = $arr[$j+1]; $arr[$j+1] = $k; } } print $size;

preferences:
32.73 ms | 405 KiB | 5 Q