3v4l.org

run code in 300+ PHP versions simultaneously
<?php const INT_COUNT = 1000000; // Fill an array with random ints $ints = []; 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(): %.3f seconds\n", $finish - $start); // Now do it again, but this time use an asort // Fill an array with random ints $ints = []; for ($i = 0; $i < INT_COUNT; $i++){ $ints[] = rand(0, 255); } // asort the ints asort($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 asort(): %.3f 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.0570.49347.77
7.3.110.0370.51647.61
7.3.100.0560.53747.55
7.3.90.0470.49447.86
7.3.80.0370.50347.53
7.3.70.0730.52347.83
7.3.60.0300.52047.67
7.3.50.0330.50347.48
7.3.40.0360.51747.61
7.3.30.0330.49847.51
7.3.20.0640.46850.54
7.3.10.0570.48049.88
7.3.00.0560.49650.51
7.2.240.0470.54947.57
7.2.230.0470.49447.97
7.2.220.0560.55447.90
7.2.210.0360.58747.91
7.2.200.0430.51447.91
7.2.190.0630.50847.98
7.2.180.0500.50148.07
7.2.170.0600.55248.03
7.2.160.0530.54847.75
7.2.150.0560.52750.93
7.2.140.0460.56750.16
7.2.130.0760.50450.78
7.2.120.0650.55450.94
7.2.110.0830.49351.04
7.2.100.0940.49950.47
7.2.90.0330.48051.02
7.2.80.0800.54850.98
7.2.70.0420.08950.78
7.2.60.0170.52150.97
7.2.50.0270.50450.57
7.2.40.0430.51450.90
7.2.30.0200.58350.74
7.2.20.0340.48150.84
7.2.10.0860.60050.76
7.2.00.0400.51152.18
7.1.330.0630.69149.79
7.1.320.0690.66049.92
7.1.310.0400.68649.29
7.1.300.0460.78249.65
7.1.290.0660.67149.52
7.1.280.0600.67449.91
7.1.270.0470.70249.58
7.1.260.0560.68949.58
7.1.250.0730.68549.76
7.1.70.0030.61050.99
7.1.60.0200.56051.50
7.1.50.0570.56651.07
7.1.00.0000.52356.36
7.0.200.5650.61148.38
7.0.140.0130.57056.00
7.0.91.7870.52353.04
7.0.81.6500.51052.97
7.0.71.6730.53352.96
7.0.61.6200.49352.98
7.0.51.6370.45053.35
7.0.41.7070.49051.93
7.0.31.6830.51052.12
7.0.21.6700.50352.06
7.0.11.4900.45052.04
7.0.01.4230.45352.10
5.6.280.0130.22785.55
5.6.230.0400.20085.32
5.6.220.0400.17385.23
5.6.210.0100.16385.32
5.6.200.0130.15385.58
5.6.190.0330.21785.78
5.6.180.0600.14085.61
5.6.170.0300.22085.68
5.6.160.0170.12385.77
5.6.150.0130.13085.75
5.6.140.0200.13085.70
5.6.130.0200.14385.61
5.6.120.0100.16385.73
5.6.110.0230.14385.65
5.6.100.0130.16385.73
5.6.90.0300.19385.73
5.6.80.0270.20785.11
5.6.70.0230.15085.07
5.6.60.0230.19785.02
5.6.50.0130.15784.96
5.6.40.0330.18785.09
5.6.30.0200.16085.02
5.6.20.0330.13385.11
5.6.10.0100.15785.06
5.6.00.0070.18085.01
5.5.370.0270.18085.04
5.5.360.0330.13785.00
5.5.350.0230.17385.07
5.5.340.0330.17085.53
5.5.330.0170.20085.53
5.5.320.0370.19085.48
5.5.310.0130.17385.47
5.5.300.0170.15085.54
5.5.290.0170.13385.38
5.5.280.0130.21785.48
5.5.270.0230.15085.42
5.5.260.0270.17785.36
5.5.250.0130.20085.34
5.5.240.0230.20384.75
5.5.230.0230.22084.94
5.5.220.0270.17384.81
5.5.210.0300.20084.85
5.5.200.0270.17384.64
5.5.190.0270.17784.89
5.5.180.0530.17384.75
5.5.160.0330.13784.86
5.5.150.0200.19784.82
5.5.140.0170.18084.88
5.5.130.0330.17384.91
5.5.120.0270.21384.89
5.5.110.0270.19784.82
5.5.100.0270.20084.72
5.5.90.0400.19084.75
5.5.80.0100.20384.62
5.5.70.0230.19784.70
5.5.60.0170.17084.70
5.5.50.0170.22084.69
5.5.40.0170.15084.70
5.5.30.0230.17784.72
5.5.20.0330.21084.73
5.5.10.0330.20784.75
5.5.00.0270.15384.76
5.4.450.0230.13083.86
5.4.440.0170.20783.80
5.4.430.0370.16084.04
5.4.420.0200.15783.87
5.4.410.0170.15083.82
5.4.400.0300.18383.54
5.4.390.0400.13783.53
5.4.380.0430.19083.37
5.4.370.0330.13083.73
5.4.360.0230.21083.73
5.4.350.0170.22383.48
5.4.340.0170.18083.69
5.4.320.0270.19083.47
5.4.310.0270.14083.61
5.4.300.0370.18083.69
5.4.290.0270.19383.34
5.4.280.0270.20083.51
5.4.270.0200.18083.66
5.4.260.0200.21783.67
5.4.250.0300.17383.66
5.4.240.0330.16383.71
5.4.230.0170.18083.46
5.4.220.0200.21083.64
5.4.210.0100.22083.54
5.4.200.0370.19383.61
5.4.190.0370.20083.35
5.4.180.0200.14783.57
5.4.170.0130.18383.54
5.4.160.0270.21783.61
5.4.150.0330.14383.52
5.4.140.0300.20080.70
5.4.130.0300.19080.73
5.4.120.0500.19780.90
5.4.110.0230.19780.89
5.4.100.0300.18380.93
5.4.90.0300.15380.88
5.4.80.0200.16380.85
5.4.70.0400.13780.85
5.4.60.0200.15081.00
5.4.50.0230.15080.99
5.4.40.0430.13080.94
5.4.30.0200.14780.78
5.4.20.0300.18780.75
5.4.10.0130.15380.79
5.4.00.0430.20380.34
5.3.290.0270.03314.63
5.3.280.0130.05014.56
5.3.270.0030.08014.57
5.3.260.0000.05714.55
5.3.250.0030.08314.51
5.3.240.0030.05314.59
5.3.230.0100.06714.54
5.3.220.0070.07714.40
5.3.210.0000.04314.56
5.3.200.0000.04714.39
5.3.190.0070.04014.52
5.3.180.0100.07314.52
5.3.170.0070.04714.56
5.3.160.0100.07314.53
5.3.150.0100.07014.55
5.3.140.0070.04314.50
5.3.130.0030.03714.39
5.3.120.0070.07014.48
5.3.110.0100.04314.38
5.3.100.0070.05013.89
5.3.90.0030.07314.03
5.3.80.0030.03313.96
5.3.70.0070.03013.99
5.3.60.0030.07013.99
5.3.50.0030.04313.80
5.3.40.0070.06713.79
5.3.30.0000.04713.77
5.3.20.0030.03313.67
5.3.10.0070.04313.64
5.3.00.0030.06713.64
5.2.170.0030.06713.64
5.2.160.0030.02713.64
5.2.150.0030.06313.64
5.2.140.0000.04013.64
5.2.130.0030.06013.64
5.2.120.0030.05713.64
5.2.110.0100.05013.64
5.2.100.0000.04313.64
5.2.90.0030.04013.64
5.2.80.0130.05013.64
5.2.70.0030.03713.64
5.2.60.0000.05013.64
5.2.50.0100.05313.64
5.2.40.0100.06013.64
5.2.30.0070.05313.64
5.2.20.0030.06013.64
5.2.10.0100.05313.64
5.2.00.0100.05713.64
5.1.60.0000.04313.64
5.1.50.0030.04013.64
5.1.40.0030.03013.64
5.1.30.0070.04313.64
5.1.20.0170.02313.64
5.1.10.0100.03713.64
5.1.00.0070.03013.64
5.0.50.0000.02313.64
5.0.40.0100.03013.64
5.0.30.0030.06313.64
5.0.20.0070.04013.64
5.0.10.0100.02713.64
5.0.00.0070.03713.64
4.4.90.0030.02713.64
4.4.80.0030.02313.64
4.4.70.0030.02713.64
4.4.60.0030.03013.64
4.4.50.0000.03713.64
4.4.40.0030.03713.64
4.4.30.0000.02013.64
4.4.20.0030.01713.64
4.4.10.0000.03713.64
4.4.00.0030.05713.64
4.3.110.0070.01713.64
4.3.100.0000.03013.64
4.3.90.0000.03713.64
4.3.80.0030.05313.64
4.3.70.0070.02013.64
4.3.60.0070.02013.64
4.3.50.0030.03313.64
4.3.40.0000.04313.64
4.3.30.0000.02013.64
4.3.20.0000.02713.64
4.3.10.0000.02013.64
4.3.00.0000.01713.64

preferences:
35.33 ms | 401 KiB | 5 Q