3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('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($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.09822.01
7.4.00.0150.08921.53
7.3.130.0200.05621.67
7.3.120.0150.08221.54
7.3.110.0180.08621.55
7.3.100.0260.06821.59
7.3.90.0080.06421.57
7.3.80.0130.08421.63
7.3.70.0160.05721.65
7.3.60.0070.06721.56
7.3.50.0180.06621.62
7.3.40.0100.06421.51
7.3.30.0100.06021.78
7.3.20.0050.05624.46
7.3.10.0190.06024.51
7.3.00.0160.06124.52
7.2.260.0230.09321.66
7.2.250.0200.09521.96
7.2.240.0100.08321.83
7.2.230.0150.05422.04
7.2.220.0120.05721.90
7.2.210.0150.07022.06
7.2.200.0200.05121.74
7.2.190.0070.07821.83
7.2.180.0130.06321.87
7.2.170.0100.05821.66
7.2.160.0080.06321.61
7.2.150.0070.06024.80
7.2.140.0050.06424.74
7.2.130.0180.05824.72
7.2.120.0270.06124.74
7.2.110.0200.06524.72
7.2.100.0160.06424.64
7.2.90.0250.06024.66
7.2.80.0200.06324.74
7.2.70.0140.06324.76
7.2.60.0240.05524.82
7.2.50.0200.05824.77
7.2.40.0160.06024.86
7.2.30.0200.06724.79
7.2.20.0140.05524.92
7.2.10.0130.05924.72
7.2.00.0130.06324.87
7.1.330.0080.08323.58
7.1.320.0080.08423.81
7.1.310.0080.08423.84
7.1.300.0150.09023.81
7.1.290.0070.08123.69
7.1.280.0070.08023.64
7.1.270.0050.09323.87
7.1.260.0070.08523.81
7.1.250.0140.08723.53
7.1.240.0190.08923.69
7.1.230.0140.07823.77
7.1.220.0190.08023.58
7.1.210.0130.08123.71
7.1.200.0210.09023.73
7.1.190.0100.08823.63
7.1.180.0150.08023.78
7.1.170.0080.08123.72
7.1.160.0100.09023.79
7.1.150.0070.09623.78
7.1.140.0070.08723.79
7.1.130.0080.08923.83
7.1.120.0110.08523.74
7.1.110.0070.08723.68
7.1.100.0080.08823.70
7.1.90.0120.08123.91
7.1.80.0050.09123.76
7.1.70.0080.07524.04
7.1.60.0030.09423.98
7.1.50.0110.08123.90
7.1.40.0070.09823.70
7.1.30.0070.09223.67
7.1.20.0100.08623.58
7.1.10.0080.08823.59
7.1.00.0060.10525.28
7.0.330.0170.09523.32
7.0.320.0120.08523.34
7.0.310.0100.08823.45
7.0.300.0120.07923.49
7.0.290.0070.08923.45
7.0.280.0040.09823.24
7.0.270.0050.09023.33
7.0.260.0080.08423.33
7.0.250.0060.08623.45
7.0.240.0050.08623.50
7.0.230.0130.08623.36
7.0.220.0140.08923.42
7.0.210.0100.08123.35
7.0.200.0190.07523.66
7.0.190.0070.10523.43
7.0.180.0110.09023.42
7.0.170.0080.08023.37
7.0.160.0130.07823.38
7.0.150.0070.09623.25
7.0.140.0080.10625.04
7.0.130.0100.08223.31
7.0.120.0080.08623.35
7.0.110.0080.08823.51
7.0.100.0070.08523.29
7.0.90.0090.08323.32
7.0.80.0630.10124.26
7.0.70.0940.09524.19
7.0.60.0910.09324.30
7.0.50.0340.09324.36
7.0.40.0810.09922.53
7.0.30.0740.09822.59
7.0.20.0850.09822.73
7.0.10.0910.09822.64
7.0.00.0820.10122.49
5.6.400.0200.29729.65
5.6.390.0070.29329.52
5.6.380.0130.29229.46
5.6.370.0090.28529.44
5.6.360.0190.26429.66
5.6.350.0150.29229.34
5.6.340.0140.28629.31
5.6.330.0090.28829.35
5.6.320.0170.27629.40
5.6.310.0110.27629.45
5.6.300.0140.28629.43
5.6.290.0190.27029.33
5.6.280.0110.27129.43
5.6.270.0130.28629.33
5.6.260.0110.28829.36
5.6.250.0190.27829.36
5.6.240.0120.28629.32
5.6.230.0130.28230.99
5.6.220.0120.28331.03
5.6.210.0090.30030.96
5.6.200.0160.28030.88
5.6.190.0120.28331.08
5.6.180.0150.30631.06
5.6.170.0150.29630.92
5.6.160.0190.29731.00
5.6.150.0160.29131.03
5.6.140.0080.29030.99
5.6.130.0150.29630.98
5.6.120.0110.31031.05
5.6.110.0180.29931.10
5.6.100.0120.32131.09
5.6.90.0140.30131.11
5.6.80.0090.31130.83
5.6.70.0170.28730.80
5.6.60.0120.31430.84
5.6.50.0190.29330.79
5.6.40.0180.29330.76
5.6.30.0160.29230.96
5.6.20.0120.30230.85
5.6.10.0210.26530.96
5.6.00.0070.29430.75
5.5.380.0100.33128.39
5.5.370.0180.29730.04
5.5.360.0160.27729.99
5.5.350.0150.29330.09
5.5.340.0130.31430.21
5.5.330.0120.30630.15
5.5.320.0080.30530.09
5.5.310.0180.31330.32
5.5.300.0140.29930.14
5.5.290.0170.31430.28
5.5.280.0110.31430.06
5.5.270.0120.29530.09
5.5.260.0120.30629.96
5.5.250.0120.32130.08
5.5.240.0120.30830.09
5.5.230.0160.32229.93
5.5.220.0160.28630.00
5.5.210.0140.32430.04
5.5.200.0120.29329.98
5.5.190.0130.31429.89
5.5.180.0100.30629.92
5.5.170.0120.32928.15
5.5.160.0150.29629.90
5.5.150.0110.28630.11
5.5.140.0110.29029.93
5.5.130.0140.29429.92
5.5.120.0070.27829.98
5.5.110.0090.30129.99
5.5.100.0120.28829.85
5.5.90.0110.30729.87
5.5.80.0120.30329.88
5.5.70.0220.30329.97
5.5.60.0170.31629.82
5.5.50.0140.31329.95
5.5.40.0130.31330.00
5.5.30.0050.30929.83
5.5.20.0120.26929.88
5.5.10.0150.28829.91
5.5.00.0180.29729.80
5.4.450.0170.28328.04
5.4.440.0120.29828.18
5.4.430.0160.30928.19
5.4.420.0160.31428.17
5.4.410.0140.28428.12
5.4.400.0120.31328.11
5.4.390.0130.30527.95
5.4.380.0120.30927.92
5.4.370.0130.27227.76
5.4.360.0180.27428.12
5.4.350.0100.32727.98
5.4.340.0130.29427.85
5.4.330.0170.31126.06
5.4.320.0100.29127.96
5.4.310.0100.31027.86
5.4.300.0140.27927.86
5.4.290.0130.27927.89
5.4.280.0070.27427.93
5.4.270.0100.29628.06
5.4.260.0150.28827.84
5.4.250.0130.28627.96
5.4.240.0110.29427.88
5.4.230.0130.29927.95
5.4.220.0110.30227.94
5.4.210.0090.28427.91
5.4.200.0120.28927.95
5.4.190.0070.28727.93
5.4.180.0070.29028.01
5.4.170.0070.28627.93
5.4.160.0110.31527.97
5.4.150.0100.31628.02
5.4.140.0120.27427.33
5.4.130.0080.30327.27
5.4.120.0060.28627.40
5.4.110.0120.30527.28
5.4.100.0130.32127.27
5.4.90.0120.30227.30
5.4.80.0120.29627.34
5.4.70.0160.31727.34
5.4.60.0140.28027.26
5.4.50.0070.32527.34
5.4.40.0110.33027.32
5.4.30.0170.32127.48
5.4.20.0120.30127.33
5.4.10.0120.27327.32
5.4.00.0120.27827.19
5.3.290.0150.30926.26
5.3.280.0120.29826.32
5.3.270.0110.29226.14
5.3.260.0150.32926.18
5.3.250.0150.30226.19
5.3.240.0120.28926.05
5.3.230.0130.32326.15
5.3.220.0120.30826.08
5.3.210.0090.31326.08
5.3.200.0100.31026.00
5.3.190.0170.32726.16
5.3.180.0100.28926.19
5.3.170.0160.30826.20
5.3.160.0060.32426.19
5.3.150.0140.33526.17
5.3.140.0100.33826.15
5.3.130.0120.29726.19
5.3.120.0080.31426.13
5.3.110.0130.30126.13
5.3.100.0120.30825.95
5.3.90.0100.32225.97
5.3.80.0070.30825.75
5.3.70.0070.34025.80
5.3.60.0060.32725.80
5.3.50.0070.30425.85
5.3.40.0180.30525.94
5.3.30.0120.28825.93
5.3.20.0140.30826.12
5.3.10.0130.29325.62
5.3.00.0090.28425.59
5.2.170.0100.29024.20
5.2.160.0130.29224.15
5.2.150.0130.28424.20
5.2.140.0130.30723.96
5.2.130.0080.28023.94
5.2.120.0180.30324.04
5.2.110.0120.28024.14
5.2.100.0130.29424.14
5.2.90.0070.30424.01
5.2.80.0170.30423.89
5.2.70.0170.29823.90
5.2.60.0080.30223.83
5.2.50.0130.29123.91
5.2.40.0130.29323.95
5.2.30.0150.30223.82
5.2.20.0130.32523.88
5.2.10.0100.30023.77
5.2.00.0130.34923.57
5.1.60.0070.37827.88
5.1.50.0080.36927.84
5.1.40.0130.36227.88
5.1.30.0100.31228.02
5.1.20.0180.34027.93
5.1.10.0070.35227.90
5.1.00.0150.35327.83
5.0.50.0130.43326.67
5.0.40.0100.42126.54
5.0.30.0120.42626.32
5.0.20.0120.41726.36
5.0.10.0180.46226.37
5.0.00.0130.40926.36
4.4.90.0100.44224.01
4.4.80.0120.41324.12
4.4.70.0130.42024.11
4.4.60.0120.40823.99
4.4.50.0120.37724.04
4.4.40.0100.40424.09
4.4.30.0130.41724.06
4.4.20.0070.42524.13
4.4.10.0110.40224.05
4.4.00.0070.38823.99
4.3.110.0130.42323.90
4.3.100.0360.40223.95
4.3.90.0050.37924.00
4.3.80.0080.42523.93
4.3.70.0050.42323.95
4.3.60.0050.40923.95
4.3.50.0080.40723.94
4.3.40.0080.41324.00
4.3.30.0080.40423.02
4.3.20.0280.71022.98
4.3.10.0500.65623.01
4.3.00.0530.65122.99

preferences:
43.26 ms | 401 KiB | 5 Q