3v4l.org

run code in 300+ PHP versions simultaneously
<?php const INT_COUNT = 100000; // 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($ints); // 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.3.120.0030.06424.01
7.3.110.0100.06323.47
7.3.100.0130.05223.93
7.3.90.0140.05423.80
7.3.80.0160.05223.88
7.3.70.0100.05823.62
7.3.60.0170.05123.68
7.3.50.0130.06323.54
7.3.40.0130.06323.81
7.3.30.0130.05523.65
7.3.20.0100.05326.70
7.3.10.0100.05526.61
7.3.00.0190.04526.81
7.2.240.0060.05823.43
7.2.230.0060.05823.64
7.2.220.0100.06723.38
7.2.210.0100.06123.59
7.2.200.0030.06923.55
7.2.190.0030.06623.33
7.2.180.0070.05923.38
7.2.170.0070.06623.39
7.2.160.0070.06723.34
7.2.150.0100.05526.79
7.2.140.0100.05326.87
7.2.130.0070.05926.85
7.2.120.0070.05726.88
7.2.110.0100.05526.83
7.2.100.0030.06027.03
7.2.90.0070.06526.71
7.2.80.0200.04326.88
7.2.70.0100.05426.88
7.2.60.0030.06226.78
7.2.50.0130.05727.03
7.2.40.0030.06026.67
7.2.30.0030.05626.64
7.2.20.0100.06026.97
7.2.10.0130.04927.07
7.2.00.0100.05628.05
7.1.330.0070.07925.62
7.1.320.0030.08225.79
7.1.310.0070.08925.96
7.1.300.0070.08025.80
7.1.290.0030.08625.79
7.1.280.0130.07425.84
7.1.270.0130.07425.87
7.1.260.0100.07625.74
7.1.250.0100.08025.43
7.1.70.0030.06627.10
7.1.60.0070.09927.29
7.1.50.0070.10027.05
7.1.00.0000.15732.27
7.0.200.0450.04826.77
7.0.140.0030.13732.11
7.0.70.0030.10331.70
7.0.60.0070.14031.90
7.0.50.0070.12032.13
7.0.40.0070.10730.13
7.0.30.0170.14029.92
7.0.20.0070.14330.11
7.0.10.0100.13029.99
7.0.00.0070.10730.12
5.6.280.0100.28050.02
5.6.220.0570.24749.42
5.6.210.0100.25749.52
5.6.200.0130.26049.94
5.6.190.0130.26749.95
5.6.180.0200.26350.07
5.6.170.0200.25349.94
5.6.160.0130.32750.00
5.6.150.0170.24749.92
5.6.140.0100.22749.95
5.6.130.0100.24349.94
5.6.120.0130.27749.99
5.6.110.0170.28349.99
5.6.100.0230.28349.93
5.6.90.0170.27349.89
5.6.80.0130.23749.31
5.6.70.0170.21349.29
5.6.60.0130.26749.28
5.6.50.0100.25749.26
5.6.40.0170.23349.20
5.6.30.0170.27049.34
5.6.20.0170.26049.27
5.6.10.0170.28749.34
5.6.00.0170.27749.31
5.5.360.0130.28049.23
5.5.350.0100.27749.35
5.5.340.0100.24749.71
5.5.330.0170.23049.80
5.5.320.0100.27349.81
5.5.310.0200.26349.73
5.5.300.0130.28049.73
5.5.290.0030.27349.74
5.5.280.0470.26349.80
5.5.270.0100.26349.81
5.5.260.0100.29049.73
5.5.250.0170.26749.61
5.5.240.0130.26349.04
5.5.230.0130.22049.11
5.5.220.0130.21749.08
5.5.210.0270.27349.03
5.5.200.0200.24049.13
5.5.190.0230.20749.11
5.5.180.0170.29049.04
5.5.160.0230.26749.12
5.5.150.0070.28749.14
5.5.140.0100.21049.12
5.5.130.0570.26749.00
5.5.120.0130.30349.08
5.5.110.0130.28749.16
5.5.100.0200.27749.07
5.5.90.0130.28348.85
5.5.80.0370.25349.06
5.5.70.0030.25748.96
5.5.60.0030.22348.80
5.5.50.0100.24748.95
5.5.40.0270.28048.93
5.5.30.0170.28048.95
5.5.20.0130.26748.85
5.5.10.0200.26348.91
5.5.00.0170.22048.91
5.4.450.0170.23748.19
5.4.440.0000.28748.09
5.4.430.0170.20748.13
5.4.420.0070.29348.17
5.4.410.0130.26048.04
5.4.400.0130.29347.81
5.4.390.0100.26747.74
5.4.380.0170.22747.80
5.4.370.0200.25347.77
5.4.360.0230.21747.85
5.4.350.0070.26047.86
5.4.340.0230.27347.64
5.4.320.0170.26047.85
5.4.310.0070.21347.85
5.4.300.0200.23747.85
5.4.290.0070.21347.76
5.4.280.0470.26347.85
5.4.270.0070.26347.90
5.4.260.0500.26047.75
5.4.250.0230.24747.94
5.4.240.0270.28047.70
5.4.230.0100.28347.79
5.4.220.0400.23747.79
5.4.210.0130.26047.63
5.4.200.0230.27347.70
5.4.190.0400.19047.91
5.4.180.0170.27747.84
5.4.170.0230.24747.80
5.4.160.0130.24047.74
5.4.150.0100.29047.72
5.4.140.0100.27745.22
5.4.130.0070.21345.21
5.4.120.0100.22745.20
5.4.110.0100.27045.18
5.4.100.0070.24045.20
5.4.90.0170.26045.11
5.4.80.0130.28345.07
5.4.70.0170.27045.04
5.4.60.0100.25045.19
5.4.50.0100.20045.03
5.4.40.0200.22745.26
5.4.30.0170.23345.09
5.4.20.0100.21745.26
5.4.10.0100.24745.09
5.4.00.0100.22744.43
5.3.290.0200.24043.14
5.3.280.0130.28743.05
5.3.270.0130.26743.13
5.3.260.0070.27343.14
5.3.250.0200.22343.07
5.3.240.0070.30742.98
5.3.230.0270.22042.98
5.3.220.0130.28043.11
5.3.210.0100.24742.95
5.3.200.0130.29043.09
5.3.190.0200.20043.00
5.3.180.0130.27043.05
5.3.170.0270.25743.09
5.3.160.0200.26042.93
5.3.150.0130.25343.17
5.3.140.0100.26743.02
5.3.130.0130.25042.93
5.3.120.0130.23042.98
5.3.110.0100.22743.09
5.3.100.0030.24042.37
5.3.90.0170.22742.55
5.3.80.0130.21342.55
5.3.70.0070.29742.55
5.3.60.0070.22342.46
5.3.50.0100.21742.42
5.3.40.0030.22342.25
5.3.30.0070.22342.24
5.3.20.0130.21342.13
5.3.10.0030.20342.13
5.3.00.0230.19042.07
5.2.170.0000.03013.34
5.2.160.0000.02713.34
5.2.150.0000.03013.34
5.2.140.0030.02713.34
5.2.130.0000.02713.34
5.2.120.0000.02313.34
5.2.110.0000.04313.34
5.2.100.0000.03713.34
5.2.90.0000.04713.34
5.2.80.0000.03013.34
5.2.70.0000.03013.34
5.2.60.0000.03013.34
5.2.50.0000.03013.34
5.2.40.0000.02713.34
5.2.30.0000.03013.34
5.2.20.0070.02313.34
5.2.10.0030.03313.34
5.2.00.0000.03013.34
5.1.60.0000.02313.34
5.1.50.0000.02713.34
5.1.40.0000.03313.34
5.1.30.0000.04013.34
5.1.20.0070.03313.34
5.1.10.0030.05713.34
5.1.00.0000.06013.34
5.0.50.0070.03313.34
5.0.40.0070.04013.34
5.0.30.0100.03313.34
5.0.20.0000.03313.34
5.0.10.0030.02713.34
5.0.00.0000.05713.34
4.4.90.0000.01313.34
4.4.80.0000.01313.34
4.4.70.0000.01313.34
4.4.60.0000.01313.34
4.4.50.0000.01713.34
4.4.40.0000.02313.34
4.4.30.0000.01313.34
4.4.20.0030.01713.34
4.4.10.0000.03713.34
4.4.00.0030.05313.34
4.3.110.0000.03313.34
4.3.100.0000.03313.34
4.3.90.0000.03013.34
4.3.80.0000.05013.34
4.3.70.0030.02013.34
4.3.60.0000.03013.34
4.3.50.0030.03713.34
4.3.40.0030.03313.34
4.3.30.0000.03013.34
4.3.20.0000.03013.34
4.3.10.0070.02313.34
4.3.00.0000.03013.34

preferences:
36.18 ms | 401 KiB | 5 Q