3v4l.org

run code in 300+ PHP versions simultaneously
<?php $starttime = microtime(true); $array = [3,4,1,3,5,1,92,2,4124,424,52,12]; $array_count = count($array); for ($c=0;$c<100000;$c++) { for ($i=0;$i<$array_count;$i++) { for ($y=0;$y<$array_count-1;$y++) { if ($array[$y+1] < $array[$y]) { $t = $array[$y]; $array[$y] = $array[$y+1]; $array[$y+1] = $t; } } } } echo microtime(true) - $starttime;

Abusive script

This script was stopped while abusing our resources


preferences:
34.66 ms | 402 KiB | 5 Q