3v4l.org

run code in 300+ PHP versions simultaneously
<?php function aff($t){ for($i=0;$i<count($t);$i++){ echo $t[$i]." "; } echo "<br />"; } function tablTrie($t){ for($i=0; $i < count($t)-1; $i++){ if($t[$i]>$t[$i+1]){return false;} } return true; } function trier(&$t){ if(!tablTrie($t)){trier2($t);} } function permuter (&$t,$i,$j){ $save=$t[$i]; $t[$i]=$t[$j]; $t[$j]=$save; } function trier2($t){ $u=0; for($i=0;$i<count($t)-1;$i++){ while($t[$i]>$t[$i+1]){ if($t[$i]<$t[$u]){$u=$u+1;} permuter($t,$u,$i); } } } //exemple d'appel $t=array(1,2,11,24,19,28,12,16,3,4,5,6,7,8,9,10); aff($t). "<br>"; trier($t); aff($t). "<br>"; ?>

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.3.70.0130.00318.43
8.3.60.0220.00016.75
8.3.50.0340.00321.28
8.3.40.0120.00318.84
8.3.30.0110.00718.84
8.3.20.0090.00920.20
8.3.10.0070.01123.42
8.3.00.0080.00023.65
8.2.190.0160.00616.58
8.2.180.0120.00316.63
8.2.170.0140.00722.96
8.2.160.0070.01020.40
8.2.150.0140.00424.18
8.2.140.0060.00324.66
8.2.130.0000.00821.03
8.2.120.0080.00026.35
8.2.110.0030.00621.05
8.2.100.0070.00718.05
8.2.90.0000.00919.34
8.2.80.0050.00318.05
8.2.70.0040.00417.50
8.2.60.0080.00017.93
8.2.50.0050.00318.07
8.2.40.0000.00922.34
8.2.30.0070.00020.64
8.2.20.0040.00417.80
8.2.10.0030.00618.20
8.2.00.0060.00318.09
8.1.280.0040.01125.92
8.1.270.0030.00723.82
8.1.260.0080.00028.09
8.1.250.0060.00328.09
8.1.240.0030.02020.98
8.1.230.0040.00818.97
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0030.00518.64
8.1.160.0070.00020.79
8.1.150.0040.00718.88
8.1.140.0000.00719.53
8.1.130.0070.00017.68
8.1.120.0000.00717.38
8.1.110.0050.00317.50
8.1.100.0040.00417.39
8.1.90.0040.00417.38
8.1.80.0070.00017.53
8.1.70.0000.00717.51
8.1.60.0040.00417.57
8.1.50.0070.00317.50
8.1.40.0030.00517.55
8.1.30.0000.00817.74
8.1.20.0030.00517.53
8.1.10.0000.00717.64
8.1.00.0000.00817.53
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0030.00318.33
8.0.270.0000.00717.30
8.0.260.0070.00017.29
8.0.250.0000.00716.87
8.0.240.0050.00516.96
8.0.230.0080.00016.88
8.0.220.0030.00316.78
8.0.210.0030.00616.99
8.0.200.0000.00816.94
8.0.190.0000.00816.98
8.0.180.0060.00316.92
8.0.170.0070.00316.86
8.0.160.0080.00016.87
8.0.150.0000.00716.83
8.0.140.0030.00616.88
8.0.130.0070.00013.40
8.0.120.0000.00816.89
8.0.110.0050.00316.80
8.0.100.0000.00716.74
8.0.90.0080.00016.96
8.0.80.0070.00716.94
8.0.70.0000.00816.90
8.0.60.0030.00516.91
8.0.50.0040.00416.77
8.0.30.0060.01116.93
8.0.20.0090.01017.40
8.0.10.0040.00416.95
8.0.00.0140.00616.79
7.4.330.0020.00216.76
7.4.320.0000.00616.43
7.4.300.0000.00716.58
7.4.290.0000.00716.53
7.4.280.0030.00616.65
7.4.270.0000.00716.48
7.4.260.0040.00416.46
7.4.250.0040.00416.55
7.4.240.0020.00516.64
7.4.230.0030.00316.38
7.4.220.0090.00916.52
7.4.210.0090.00616.65
7.4.200.0030.00316.43
7.4.160.0100.01016.30
7.4.150.0090.00917.40
7.4.140.0120.01017.86
7.4.130.0120.00716.56
7.4.120.0070.01016.54
7.4.110.0100.01316.41
7.4.100.0070.01516.33
7.4.90.0100.00716.50
7.4.80.0090.01319.39
7.4.70.0060.01016.52
7.4.60.0090.00616.42
7.4.50.0040.00716.50
7.4.40.0040.01416.59
7.4.30.0120.00916.73
7.4.00.0070.00715.14
7.3.330.0000.00613.18
7.3.320.0000.00613.47
7.3.310.0000.00716.29
7.3.300.0000.00716.31
7.3.290.0040.00416.30
7.3.280.0060.01016.41
7.3.270.0110.00617.40
7.3.260.0040.01316.30
7.3.250.0130.00716.46
7.3.240.0090.00916.53
7.3.230.0130.00416.41
7.3.210.0090.00916.68
7.3.200.0100.01716.70
7.3.190.0120.00616.36
7.3.180.0090.00616.73
7.3.170.0080.00816.39
7.3.160.0000.01816.49
7.2.330.0090.00916.83
7.2.320.0070.01116.48
7.2.310.0130.00316.70
7.2.300.0030.01516.79
7.2.290.0110.01116.50
7.2.60.0170.00016.69
7.2.00.0030.00919.51
7.1.200.0050.00515.98
7.1.100.0040.00817.95
7.1.70.0040.00417.36
7.1.60.0040.01919.06
7.1.50.0100.01416.65
7.1.00.0100.07022.54
7.0.200.0000.01116.79
7.0.60.0130.07319.85
7.0.50.0100.08017.88
7.0.40.0030.04720.10
7.0.30.0200.04720.16
7.0.20.0330.07720.10
7.0.10.0030.06020.15
7.0.00.0100.04720.06
5.6.280.0070.03020.83
5.6.210.0100.07320.61
5.6.200.0030.06318.29
5.6.190.0100.08720.66
5.6.180.0100.05020.58
5.6.170.0300.05020.71
5.6.160.0030.06320.54
5.6.150.0000.04318.20
5.6.140.0070.03718.16
5.6.130.0100.08018.29
5.6.120.0000.04321.02
5.6.110.0100.08321.10
5.6.100.0100.08021.09
5.6.90.0030.04721.04
5.6.80.0130.04020.54
5.5.350.0330.07020.48
5.5.340.0100.07717.98
5.5.330.0070.08020.37
5.5.320.0570.07320.30
5.5.310.0300.04020.51
5.5.300.0100.04718.08
5.5.290.0070.03718.08
5.5.280.0100.06020.83
5.5.270.0070.08020.83
5.5.260.0070.08320.90
5.5.250.0130.06320.80
5.5.240.0130.04020.13

preferences:
52.89 ms | 401 KiB | 5 Q