3v4l.org

run code in 300+ PHP versions simultaneously
<?php const INT_COUNT=200000; // Fill an array with random ints $ints2 = array(); for ($i = 0; $i < INT_COUNT; $i++){ $ints2[] = rand(0, 255); } // asort the ints asort($ints2); $start = microtime(true); // Do nothing but access each int in the array for ($i = 0; $i < INT_COUNT; $i++){ $ints2[$i]; } $finish = microtime(true); printf("Time taken with asort(): %.7f seconds\n", $finish - $start); unset($ints2); // Now do it again, but this time use sort // Fill an array with random ints $ints = array(); for ($i = 0; $i < INT_COUNT; $i++){ $ints[] = rand(0, 255); } // Sort the ints sort($ints); $start = microtime(true); // Do nothing but access each int in the array for ($i = 0; $i < INT_COUNT; $i++){ $ints[$i]; } $finish = microtime(true); printf("Time taken with sort(): %.7f seconds\n", $finish - $start);

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.4.10.0170.13428.01
7.4.00.0300.17327.86
7.3.130.0170.19128.05
7.3.120.0130.19327.80
7.3.110.0130.18327.73
7.3.100.0230.13027.69
7.3.90.0200.13127.46
7.3.80.0130.12927.76
7.3.70.0170.11727.78
7.3.60.0100.12127.79
7.3.50.0100.13527.71
7.3.40.0200.12927.82
7.3.30.0200.12227.76
7.3.20.0100.10830.62
7.3.10.0030.11530.63
7.3.00.0100.14130.71
7.2.260.0270.18327.99
7.2.250.0200.16527.78
7.2.240.0200.14828.21
7.2.230.0100.14327.62
7.2.220.0230.11928.29
7.2.210.0130.11127.98
7.2.200.0240.10928.12
7.2.190.0130.17727.70
7.2.180.0200.10927.90
7.2.170.0200.11028.01
7.2.160.0070.13227.93
7.2.150.0070.11230.86
7.2.140.0030.12830.89
7.2.130.0160.12130.59
7.2.120.0070.14530.77
7.2.110.0030.14230.69
7.2.100.0070.14630.79
7.2.90.0100.10330.86
7.2.80.0130.11330.52
7.2.70.0070.12030.58
7.2.60.0070.16930.95
7.2.50.0030.12030.86
7.2.40.0130.14130.89
7.2.30.0070.17730.78
7.2.20.0070.16030.96
7.2.10.0130.13630.95
7.2.00.0080.11332.15
7.1.330.0100.17029.54
7.1.320.0100.17929.71
7.1.310.0130.15329.77
7.1.300.0070.25629.89
7.1.290.0130.18529.73
7.1.280.0130.15629.52
7.1.270.0100.15829.64
7.1.260.0030.16729.79
7.1.250.0100.19429.79
7.1.240.0200.20229.80
7.1.230.0070.17429.67
7.1.220.0130.21029.93
7.1.210.0000.17529.60
7.1.200.0170.16229.91
7.1.190.0130.16329.75
7.1.180.0200.15829.79
7.1.170.0000.16129.46
7.1.160.0200.21129.79
7.1.150.0030.23329.92
7.1.140.0170.18829.69
7.1.130.0100.19629.77
7.1.120.0100.20429.77
7.1.110.0100.15529.92
7.1.100.0100.17629.89
7.1.90.0000.15929.73
7.1.80.0100.15429.65
7.1.70.0070.14531.38
7.1.60.0180.16331.56
7.1.50.0130.17631.42
7.1.40.0100.17129.79
7.1.30.0100.15429.41
7.1.20.0100.15029.91
7.1.10.0100.19529.93
7.1.00.0150.24633.81
7.0.330.0070.20029.29
7.0.320.0070.21829.26
7.0.310.0100.16329.32
7.0.300.0160.16429.29
7.0.290.0100.17329.48
7.0.280.0070.23429.37
7.0.270.0030.17929.49
7.0.260.0100.19029.54
7.0.250.0160.18129.51
7.0.240.0070.23529.29
7.0.230.0030.19829.49
7.0.220.0070.17429.58
7.0.210.0030.21929.48
7.0.200.0480.15631.15
7.0.190.0160.15129.57
7.0.180.0130.16729.56
7.0.170.0030.16929.17
7.0.160.0030.15529.30
7.0.150.0070.21229.35
7.0.140.0130.19733.61
7.0.130.0170.19829.56
7.0.120.0070.16129.38
7.0.110.0030.22329.33
7.0.100.0320.18131.22
7.0.90.0130.21831.30
7.0.80.0230.17831.25
7.0.70.0320.17431.33
7.0.60.0370.20931.25
7.0.50.0100.17931.42
7.0.40.0170.20029.91
7.0.30.0130.16829.80
7.0.20.0120.18329.91
7.0.10.0200.18529.88
7.0.00.0080.20629.81
5.6.400.0170.66544.58
5.6.390.0130.61244.38
5.6.380.0270.64344.37
5.6.370.0070.68144.13
5.6.360.0170.72544.25
5.6.350.0130.67544.16
5.6.340.0370.72944.19
5.6.330.0070.70144.69
5.6.320.0200.69144.33
5.6.310.0170.58744.36
5.6.300.0100.64944.56
5.6.290.0360.66744.58
5.6.280.0130.63148.39
5.6.270.0200.84544.70
5.6.260.0270.66844.71
5.6.250.0180.70248.16
5.6.240.0230.61747.46
5.6.230.0220.65247.39
5.6.220.0170.66547.29
5.6.210.0170.63047.39
5.6.200.0180.70647.67
5.6.190.0180.64747.63
5.6.180.0220.62547.65
5.6.170.0220.69947.65
5.6.160.0170.74047.57
5.6.150.0270.63947.63
5.6.140.0370.67347.54
5.6.130.0230.71447.62
5.6.120.0170.68447.63
5.6.110.0200.66547.51
5.6.100.0130.68547.74
5.6.90.0230.66848.29
5.6.80.0080.72547.29
5.6.70.0180.63247.33
5.6.60.0130.68347.39
5.6.50.0130.66447.23
5.6.40.0230.68347.18
5.6.30.0180.69147.19
5.6.20.0320.72347.36
5.6.10.0150.64547.40
5.6.00.0120.72347.29
5.5.380.0170.72047.24
5.5.370.0220.68747.12
5.5.360.0250.67547.27
5.5.350.0150.68547.12
5.5.340.0200.69847.47
5.5.330.0250.70947.55
5.5.320.0200.68547.40
5.5.310.0150.71147.36
5.5.300.0170.73847.44
5.5.290.0200.68447.44
5.5.280.0170.68947.44
5.5.270.0300.74047.41
5.5.260.0250.74347.30
5.5.250.0150.75647.20
5.5.240.0180.66047.08
5.5.230.0650.69546.89
5.5.220.0250.70347.08
5.5.210.0180.77946.94
5.5.200.0220.64047.18
5.5.190.0170.76647.35
5.5.180.0200.69147.35
5.5.170.0300.87244.22
5.5.160.0170.71447.01
5.5.150.0220.71746.99
5.5.140.0170.71346.98
5.5.130.0270.66447.03
5.5.120.0200.68247.13
5.5.110.0150.74747.07
5.5.100.0250.66547.06
5.5.90.0250.70247.22
5.5.80.0320.63447.03
5.5.70.0230.71947.69
5.5.60.0170.66847.00
5.5.50.0220.72847.05
5.5.40.0300.75347.13
5.5.30.0230.70847.07
5.5.20.0170.73447.03
5.5.10.0220.70746.83
5.5.00.0270.66847.09
5.4.450.0220.70245.06
5.4.440.0250.63844.94
5.4.430.0150.65845.14
5.4.420.0130.70545.07
5.4.410.0130.62944.89
5.4.400.0270.68844.89
5.4.390.0130.62744.85
5.4.380.0180.62844.78
5.4.370.0280.67044.92
5.4.360.0130.67244.85
5.4.350.0170.67944.78
5.4.340.0280.69245.43
5.4.330.0170.90940.96
5.4.320.0280.71944.86
5.4.310.0270.65244.89
5.4.300.0170.63544.99
5.4.290.0120.66644.95
5.4.280.0120.67844.83
5.4.270.0220.77344.82
5.4.260.0150.72844.78
5.4.250.0320.70444.79
5.4.240.0200.74744.78
5.4.230.0250.70244.78
5.4.220.0230.70144.88
5.4.210.0130.69244.81
5.4.200.0170.68844.85
5.4.190.0180.64744.69
5.4.180.0260.69944.90
5.4.170.0100.60144.90
5.4.160.0230.63944.62
5.4.150.0170.73844.92
5.4.140.0200.67943.44
5.4.130.0200.68443.47
5.4.120.0220.67343.45
5.4.110.0170.67843.58
5.4.100.0150.73343.72
5.4.90.0150.64343.49
5.4.80.0250.68143.49
5.4.70.0190.72043.50
5.4.60.0170.72643.63
5.4.50.0220.73543.64
5.4.40.0150.60843.37
5.4.30.0200.72243.49
5.4.20.0250.60344.18
5.4.10.0130.63343.51
5.4.00.0230.64743.15
5.3.290.0220.62142.09
5.3.280.0200.69041.92
5.3.270.0200.73141.93
5.3.260.0180.69641.93
5.3.250.0180.75541.98
5.3.240.0170.65141.81
5.3.230.0220.71341.85
5.3.220.0220.64041.79
5.3.210.0220.74841.67
5.3.200.0200.72941.73
5.3.190.0150.71841.83
5.3.180.0200.71641.87
5.3.170.0150.69641.78
5.3.160.0130.76141.96
5.3.150.0230.75441.93
5.3.140.0130.67741.80
5.3.130.0220.64741.82
5.3.120.0150.63841.85
5.3.110.0130.67741.92
5.3.100.0150.71641.70
5.3.90.0170.64441.48
5.3.80.0150.66241.46
5.3.70.0120.68241.46
5.3.60.0080.65641.39
5.3.50.0250.66841.57
5.3.40.0250.66041.48
5.3.30.0120.67941.50
5.3.20.0150.60341.42
5.3.10.0150.68041.21
5.3.00.0130.66641.08
5.2.170.0030.05712.11
5.2.160.0100.02712.11
5.2.150.0070.06312.11
5.2.140.0100.06012.11
5.2.130.0070.06012.11
5.2.120.0000.06712.11
5.2.110.0070.06012.11
5.2.100.0070.05712.11
5.2.90.0070.06312.11
5.2.80.0100.05712.11
5.2.70.0030.04012.11
5.2.60.0070.06712.11
5.2.50.0100.05712.11
5.2.40.0000.06312.11
5.2.30.0100.05312.11
5.2.20.0070.06012.11
5.2.10.0000.04312.11
5.2.00.0070.03012.11
5.1.60.0030.02312.11
5.1.50.0070.02312.11
5.1.40.0030.02312.11
5.1.30.0000.04312.11
5.1.20.0030.05712.11
5.1.10.0070.02012.11
5.1.00.0030.05712.11
5.0.50.0030.04312.11
5.0.40.0070.04312.11
5.0.30.0030.03712.11
5.0.20.0030.04712.11
5.0.10.0030.02312.11
5.0.00.0000.07012.11
4.4.90.0000.02712.11
4.4.80.0030.03312.11
4.4.70.0000.03012.11
4.4.60.0030.03012.11
4.4.50.0030.03312.11
4.4.40.0030.04012.11
4.4.30.0000.01712.11
4.4.20.0000.03012.11
4.4.10.0000.03712.11
4.4.00.0030.04312.11
4.3.110.0030.03012.11
4.3.100.0000.03012.11
4.3.90.0000.02712.11
4.3.80.0030.03712.11
4.3.70.0000.02012.11
4.3.60.0000.02012.11
4.3.50.0070.01312.11
4.3.40.0000.03712.11
4.3.30.0030.03312.11
4.3.20.0030.03712.11
4.3.10.0000.03712.11
4.3.00.0000.03312.11

preferences:
40.6 ms | 400 KiB | 5 Q