3v4l.org

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

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)
7.1.70.0000.69717.19
7.1.60.1200.65817.34
7.1.50.0030.60316.86
7.1.40.0070.61216.80
7.1.30.0070.65316.63
7.1.20.0100.62216.53
7.1.10.0100.63916.54
7.1.00.0030.61116.88
7.0.200.0030.77616.68
7.0.190.0070.64616.80
7.0.180.0200.70916.14
7.0.170.0070.70816.33
7.0.160.0100.64916.32
7.0.150.0030.69916.03
7.0.140.0000.66816.48
7.0.130.1320.67016.65
7.0.120.0030.64316.54
7.0.110.0000.73216.21
7.0.100.0030.68216.29
7.0.90.0000.69316.45
7.0.80.0940.72316.37
7.0.70.0930.64016.45
7.0.60.0030.65116.27
7.0.50.0030.65716.34
7.0.40.0030.63415.25
7.0.30.0070.66615.25
7.0.20.0070.66515.25
7.0.10.0000.68115.25
7.0.00.0030.76315.25
5.6.300.0072.24720.84
5.6.290.0072.03920.81
5.6.280.0072.12821.07
5.6.270.0102.03521.09
5.6.260.0032.00721.00
5.6.250.0072.09520.86
5.6.240.0002.09120.82
5.6.230.0102.24920.92
5.6.220.0032.09020.98
5.6.210.0072.11720.95
5.6.200.0032.16520.83
5.6.190.0072.12820.73
5.6.180.0002.05620.86
5.6.170.0071.94620.92
5.6.160.0072.06520.86
5.6.150.0032.10020.86
5.6.140.0002.26020.76
5.6.130.0332.28020.95
5.6.120.0002.16520.81
5.6.110.0172.00320.75
5.6.100.0002.08920.95
5.6.90.0032.04720.91
5.6.80.0002.02120.18
5.6.70.0072.08120.23
5.6.60.0102.01620.17
5.6.50.0002.30220.14
5.6.40.0102.15820.40
5.6.30.0002.08920.09
5.6.20.0972.26520.37
5.6.10.0032.07520.36
5.6.00.0032.01720.30
5.5.380.0032.36917.38
5.5.370.0072.17217.59
5.5.360.1202.10617.62
5.5.350.0002.18017.59
5.5.340.0072.00318.09
5.5.330.0032.20418.04
5.5.320.0072.01117.70
5.5.310.0102.15617.86
5.5.300.0032.33917.96
5.5.290.0002.18318.03
5.5.280.0072.04318.10
5.5.270.0102.02418.05
5.5.260.0032.25617.99
5.5.250.0102.21717.78
5.5.240.0032.15517.48
5.5.230.0102.23217.38
5.5.220.0102.15017.21
5.5.210.0032.22617.07
5.5.200.0032.15117.44
5.5.190.0002.45317.44
5.5.180.0002.44417.48
5.5.160.0002.24617.44
5.5.150.0002.12717.43
5.5.140.0032.28317.05
5.5.130.0002.21617.40
5.5.120.0002.16717.44
5.5.110.0032.31617.18
5.5.100.0102.38517.34
5.5.90.0132.47516.91
5.5.80.1362.28917.28
5.5.70.0032.20017.32
5.5.60.0032.25917.34
5.5.50.0032.15716.98
5.5.40.0072.10316.94
5.5.30.0032.25917.24
5.5.20.0002.11217.26
5.5.10.0032.11317.25
5.5.00.0002.22216.93
5.4.450.0072.21919.25
5.4.440.0002.06319.39
5.4.430.0172.10119.27
5.4.420.0002.11919.21
5.4.410.0072.06219.33
5.4.400.0102.04918.92
5.4.390.0032.00319.06
5.4.380.0002.23819.20
5.4.370.0032.03719.05
5.4.360.0002.19819.11
5.4.350.0102.24019.07
5.4.340.0002.04118.95
5.4.320.0102.39618.98
5.4.310.0072.14018.98
5.4.300.0032.30319.05
5.4.290.0032.08518.94
5.4.280.0072.21719.05
5.4.270.0072.41019.15
5.4.260.0102.37019.13
5.4.250.0032.44818.91
5.4.240.0072.18619.19
5.4.230.0032.17318.93
5.4.220.0072.13818.97
5.4.210.0002.19318.94
5.4.200.0032.04918.89
5.4.190.0032.11619.12
5.4.180.0072.22519.05
5.4.170.0172.12718.96
5.4.160.0002.24419.18
5.4.150.0072.09319.11
5.4.140.0102.44916.46
5.4.130.0072.37116.40
5.4.120.0032.39016.26
5.4.110.0072.35916.46
5.4.100.0072.13716.60
5.4.90.0002.25116.48
5.4.80.0032.14616.56
5.4.70.0072.12116.75
5.4.60.0032.26716.46
5.4.50.0002.06716.68
5.4.40.0102.13216.51
5.4.30.0072.02416.32
5.4.20.0002.16016.64
5.4.10.0032.20316.59
5.4.00.0472.22216.05

preferences:
35.44 ms | 400 KiB | 5 Q