3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arreglo = array(34,2,7,1,90,45,87,23,10,8); //var_dump($arreglo); $mayor=null; $menor=null; function ordernar($a,$b) { if ($a>$b) return $b; else if ($b>=$a) return $a; } $limite = null; $ordenado = array(); $cantidad = count($arreglo); for ($i = 0; $i < $cantidad; $i++) { for ($j = $i+1; $j < $cantidad; $j++) { if (is_null($limite)) { if (is_null($menor)) $menor = ordernar($arreglo[$i],$arreglo[$j]); else if ($menor > ordernar($arreglo[$i],$arreglo[$j])) $menor = ordernar($arreglo[$i],$arreglo[$j]); }else { if (($limite==$arreglo[$i]) && ($arreglo[$i]<>$arreglo[$j])) { $menor = ordernar($arreglo[$j],$menor); } else if (($limite==$arreglo[$j]) && ($arreglo[$i]<>$arreglo[$j])) { $menor = ordernar($arreglo[$i],$menor); } else { if (is_null($menor)) $menor = ordernar($arreglo[$i],$arreglo[$j]); else if ($menor > ordernar($arreglo[$i],$arreglo[$j])) $menor = ordernar($arreglo[$i],$arreglo[$j]); } } } $limite = $menor; $ordenado = array_push($ordenado,$menor); $menor=null; } var_dump($ordenado);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.10.0090.01416.98
8.5.00.0170.00620.19
8.4.160.0100.01322.99
8.4.150.0030.00014.05
8.4.140.0130.00717.66
8.4.130.0040.00519.64
8.4.120.0120.00820.55
8.4.110.0130.00818.61
8.4.100.0110.00917.97
8.4.90.0120.00817.71
8.4.80.0100.01117.84
8.4.70.0060.00518.05
8.4.60.0130.00819.17
8.4.50.0090.00620.60
8.4.40.0060.01317.60
8.4.30.0060.01319.66
8.4.20.0040.00719.61
8.4.10.0060.00917.88
8.3.280.0080.01218.54
8.3.270.0100.00916.56
8.3.260.0110.00816.67
8.3.250.0120.00619.01
8.3.240.0150.00416.70
8.3.230.0120.00816.77
8.3.220.0030.00516.64
8.3.210.0070.01016.60
8.3.200.0070.00216.59
8.3.190.0090.00517.36
8.3.180.0100.00916.74
8.3.170.0130.00617.40
8.3.160.0180.00018.37
8.3.150.0160.00316.75
8.3.140.0000.00817.11
8.3.130.0100.01018.60
8.3.120.0060.00320.62
8.3.110.0030.00620.94
8.3.100.0130.00324.06
8.3.90.0070.01426.77
8.3.80.0070.00318.68
8.3.70.0110.00718.45
8.3.60.0040.01118.52
8.3.50.0020.01316.34
8.3.40.0070.00718.84
8.3.30.0150.00018.70
8.3.20.0000.00920.39
8.3.10.0040.00423.61
8.3.00.0080.00019.78
8.2.290.0100.00820.21
8.2.280.0090.00918.67
8.2.270.0090.00916.98
8.2.260.0120.00316.50
8.2.250.0050.00316.85
8.2.240.0090.00017.09
8.2.230.0150.00022.58
8.2.220.0110.00437.54
8.2.210.0060.01226.77
8.2.200.0030.00617.00
8.2.190.0100.01016.63
8.2.180.0100.01318.57
8.2.170.0150.00022.96
8.2.160.0160.00320.27
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0060.00319.95
8.2.120.0050.00326.35
8.2.110.0030.00620.43
8.2.100.0130.00017.91
8.2.90.0000.00818.03
8.2.80.0050.00319.40
8.2.70.0030.00618.05
8.2.60.0030.00617.93
8.2.50.0030.00518.28
8.2.40.0040.00420.60
8.2.30.0080.00019.25
8.2.20.0080.00018.08
8.2.10.0040.00418.14
8.2.00.0000.00718.12
8.1.330.0090.01016.76
8.1.320.0120.00716.53
8.1.310.0140.00418.29
8.1.300.0130.00617.54
8.1.290.0100.00030.84
8.1.280.0090.00625.92
8.1.270.0040.00420.30
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0000.01123.73
8.1.230.0100.00020.90
8.1.220.0000.00817.76
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0000.01017.38
8.1.180.0050.00318.10
8.1.170.0050.00318.72
8.1.160.0000.00718.92
8.1.150.0070.00020.13
8.1.140.0000.00717.77
8.1.130.0030.00318.95
8.1.120.0040.00417.52
8.1.110.0020.00517.43
8.1.100.0040.00417.49
8.1.90.0050.00317.47
8.1.80.0000.00717.38
8.1.70.0040.00417.53
8.1.60.0030.00617.66
8.1.50.0060.00317.61
8.1.40.0000.00717.56
8.1.30.0030.00517.66
8.1.20.0000.00917.61
8.1.10.0000.00817.47
8.1.00.0030.00517.46
8.0.300.0040.00420.03
8.0.290.0080.00016.88
8.0.280.0030.00318.52
8.0.270.0000.00717.13
8.0.260.0060.00016.81
8.0.250.0080.00017.07
8.0.240.0000.00816.92
8.0.230.0070.00016.88
8.0.220.0030.00616.89
8.0.210.0030.00316.80
8.0.200.0000.00817.04
8.0.190.0000.00816.96
8.0.180.0050.00216.83
8.0.170.0000.00816.95
8.0.160.0070.00016.94
8.0.150.0000.00816.95
8.0.140.0000.00816.92
8.0.130.0000.00513.39
8.0.120.0050.00516.93
8.0.110.0000.00817.02
8.0.100.0040.00416.80
8.0.90.0070.00016.87
8.0.80.0100.00616.97
8.0.70.0040.00416.76
8.0.60.0040.00417.09
8.0.50.0040.00416.97
8.0.30.0110.00817.02
8.0.20.0110.00817.40
8.0.10.0040.00417.14
8.0.00.0130.00616.67
7.4.330.0050.00015.55
7.4.320.0060.00016.53
7.4.300.0030.00316.60
7.4.290.0000.00716.62
7.4.280.0030.00516.37
7.4.270.0000.00716.63
7.4.260.0030.00316.52
7.4.250.0000.00716.49
7.4.240.0030.00316.65
7.4.230.0070.00016.73
7.4.220.0000.00816.50
7.4.210.0050.00816.45
7.4.200.0070.00016.60
7.4.160.0090.00816.62
7.4.150.0070.01017.40
7.4.140.0070.01117.86
7.4.130.0110.00916.48
7.4.120.0110.00816.61
7.4.110.0060.01316.59
7.4.100.0160.00016.65
7.4.90.0150.00616.50
7.4.80.0040.01419.39
7.4.70.0030.02016.36
7.4.60.0100.01016.55
7.4.50.0090.00316.64
7.4.40.0080.00816.36
7.4.00.0070.01114.97
7.3.330.0000.00513.42
7.3.320.0030.00313.46
7.3.310.0050.00316.45
7.3.300.0070.00016.32
7.3.290.0070.01016.44
7.3.280.0110.00816.43
7.3.270.0110.00817.40
7.3.260.0110.00716.61
7.3.240.0100.00816.56
7.3.230.0130.00316.52
7.3.210.0080.00816.44
7.3.200.0130.00416.64
7.3.190.0140.01016.52
7.3.180.0030.01216.47
7.3.170.0060.00916.57
7.3.160.0100.01216.43
7.2.330.0160.00016.68
7.2.320.0170.01216.86
7.2.310.0130.01016.93
7.2.300.0080.00816.80
7.2.290.0080.01116.80
7.2.60.0100.00317.00
7.2.20.0080.01617.95
7.2.10.0790.01917.84
7.2.00.0110.01217.88
7.1.200.0030.00715.94
7.1.140.0100.01516.88
7.1.130.0130.01016.72
7.1.120.0090.01617.05
7.1.110.0120.01316.28
7.1.100.0160.01016.25
7.1.90.0110.01616.20
7.1.80.0150.00916.57
7.1.70.0090.01415.30
7.1.60.0300.01833.46
7.1.50.0330.01133.02
7.1.40.0300.01932.80
7.1.30.0320.01832.63
7.1.20.0460.01632.69
7.1.10.0090.01514.74
7.1.00.0090.01114.80

preferences:
49.04 ms | 403 KiB | 5 Q