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($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.4.00.0100.09723.52
7.3.120.0170.09423.41
7.3.110.0100.07123.30
7.3.100.0200.06823.52
7.3.90.0170.05023.49
7.3.80.0070.09023.49
7.3.70.0070.09123.54
7.3.60.0140.05823.64
7.3.50.0200.05723.44
7.3.40.0170.07123.62
7.3.30.0070.06923.56
7.3.20.0070.08726.26
7.3.10.0070.08026.61
7.3.00.0030.06026.43
7.2.250.0030.08023.25
7.2.240.0160.09223.58
7.2.230.0000.06723.26
7.2.220.0200.04723.11
7.2.210.0200.08723.30
7.2.200.0100.05323.32
7.2.190.0130.08022.98
7.2.180.0070.06623.28
7.2.170.0170.05423.02
7.2.160.0140.05823.21
7.2.150.0100.05426.70
7.2.140.0030.05626.54
7.2.130.0000.06526.75
7.2.120.0130.06326.64
7.2.110.0100.05426.41
7.2.100.0070.05726.65
7.2.90.0030.07226.68
7.2.80.0030.06926.76
7.2.70.0100.05826.68
7.2.60.0100.05426.77
7.2.50.0030.06026.79
7.2.40.0100.05626.77
7.2.30.0000.06526.60
7.2.20.0070.09126.64
7.2.10.0070.06526.77
7.2.00.0100.05326.79
7.1.330.0160.10825.47
7.1.320.0070.11625.68
7.1.310.0070.11125.86
7.1.300.0030.09725.35
7.1.290.0000.10325.33
7.1.280.0000.08425.68
7.1.270.0070.09125.63
7.1.260.0070.08125.65
7.1.250.0100.07925.59
7.1.240.0070.08325.61
7.1.230.0030.09825.38
7.1.220.0130.07225.50
7.1.210.0000.11825.59
7.1.200.0100.07825.63
7.1.190.0100.07825.34
7.1.180.0000.08625.82
7.1.170.0060.07825.50
7.1.160.0070.09025.66
7.1.150.0030.09225.87
7.1.140.0130.09425.85
7.1.130.0030.09025.73
7.1.120.0070.10125.67
7.1.110.0070.10025.67
7.1.100.0000.10225.68
7.1.90.0070.10025.57
7.1.80.0130.07725.90
7.1.70.0050.06826.21
7.1.60.0030.09926.40
7.1.50.0070.09226.32
7.1.40.0070.08225.66
7.1.30.0070.08025.55
7.1.20.0130.06725.48
7.1.10.0130.06925.73
7.1.00.0030.12028.92
7.0.330.0100.08025.34
7.0.320.0100.07925.07
7.0.310.0030.08425.13
7.0.300.0030.08525.26
7.0.290.0030.08925.38
7.0.280.0030.08625.34
7.0.270.0140.07525.32
7.0.260.0070.08125.39
7.0.250.0030.09125.45
7.0.240.0100.08625.52
7.0.230.0100.07725.45
7.0.220.0000.08625.29
7.0.210.0060.08125.52
7.0.200.0220.06225.81
7.0.190.0030.08125.41
7.0.180.0100.07925.49
7.0.170.0100.07625.30
7.0.160.0160.07125.40
7.0.150.0100.08325.09
7.0.140.0020.11428.76
7.0.130.0030.08125.40
7.0.120.0000.11924.97
7.0.110.0030.09225.45
7.0.100.0220.09226.93
7.0.90.0150.12226.86
7.0.80.0260.10226.84
7.0.70.0130.09426.80
7.0.60.0450.11726.79
7.0.50.0170.12327.16
7.0.40.0180.12525.41
7.0.30.0050.13225.41
7.0.20.0100.12825.29
7.0.10.0350.10725.37
7.0.00.0170.11925.26
5.6.400.0130.28043.46
5.6.390.0260.29043.17
5.6.380.0230.29243.46
5.6.370.0100.34442.82
5.6.360.0200.28743.49
5.6.350.0130.30343.12
5.6.340.0230.27343.43
5.6.330.0100.31243.46
5.6.320.0260.28443.05
5.6.310.0200.24243.08
5.6.300.0170.28142.79
5.6.290.0230.28043.22
5.6.280.0250.31146.45
5.6.270.0070.27143.15
5.6.260.0230.26042.68
5.6.250.0080.25846.54
5.6.240.0220.25346.28
5.6.230.0270.25646.38
5.6.220.0280.26946.21
5.6.210.0200.25946.42
5.6.200.0220.27046.48
5.6.190.0150.29446.75
5.6.180.0130.28046.22
5.6.170.0100.28646.49
5.6.160.0180.29346.55
5.6.150.0250.28346.56
5.6.140.0180.25246.59
5.6.130.0130.29546.48
5.6.120.0300.26746.69
5.6.110.0300.28446.45
5.6.100.0220.31846.44
5.6.90.0220.28546.61
5.6.80.0180.27846.15
5.6.70.0130.26746.17
5.6.60.0270.32946.28
5.6.50.0180.27846.14
5.6.40.0270.26946.06
5.6.30.0150.30546.21
5.6.20.0330.27946.27
5.6.10.0150.31746.28
5.6.00.0130.27746.27
5.5.380.0130.28246.33
5.5.370.0130.30046.23
5.5.360.0200.29246.30
5.5.350.0280.30846.22
5.5.340.0100.30746.50
5.5.330.0180.31346.53
5.5.320.0230.28046.47
5.5.310.0130.31446.56
5.5.300.0220.31846.28
5.5.290.0180.30846.40
5.5.280.0150.32046.44
5.5.270.0250.30946.31
5.5.260.0080.29646.55
5.5.250.0170.30146.30
5.5.240.0170.30145.96
5.5.230.0200.31845.93
5.5.220.0260.32546.08
5.5.210.0200.28446.18
5.5.200.0200.29546.05
5.5.190.0200.30745.94
5.5.180.0130.30746.06
5.5.170.0130.31042.87
5.5.160.0250.28245.96
5.5.150.0250.31846.15
5.5.140.0170.28046.10
5.5.130.0300.27046.09
5.5.120.0130.28746.19
5.5.110.0200.28046.00
5.5.100.0150.31145.98
5.5.90.0100.35346.05
5.5.80.0400.28446.01
5.5.70.0170.29245.99
5.5.60.0150.30246.05
5.5.50.0230.29446.09
5.5.40.0150.31346.06
5.5.30.0180.31746.03
5.5.20.0200.27445.95
5.5.10.0230.30946.04
5.5.00.0120.31045.95
5.4.450.0180.28043.96
5.4.440.0350.30544.16
5.4.430.0270.28743.95
5.4.420.0150.30644.06
5.4.410.0280.27643.84
5.4.400.0180.28543.79
5.4.390.0280.26343.75
5.4.380.0130.29643.69
5.4.370.0170.27543.69
5.4.360.0120.30343.74
5.4.350.0180.30243.73
5.4.340.0150.29443.88
5.4.330.0170.30839.80
5.4.320.0180.28643.78
5.4.310.0180.28843.77
5.4.300.0150.27843.79
5.4.290.0130.29943.84
5.4.280.0170.28143.85
5.4.270.0210.28343.52
5.4.260.0200.27143.69
5.4.250.0200.26943.84
5.4.240.0300.33443.65
5.4.230.0170.30643.79
5.4.220.0220.30043.73
5.4.210.0170.29343.53
5.4.200.0150.29943.65
5.4.190.0150.28143.84
5.4.180.0250.27843.64
5.4.170.0080.30043.80
5.4.160.0180.27343.63
5.4.150.0150.28243.69
5.4.140.0100.29242.25
5.4.130.0170.28242.47
5.4.120.0130.27542.54
5.4.110.0150.27942.38
5.4.100.0350.28642.43
5.4.90.0180.27242.49
5.4.80.0120.26742.41
5.4.70.0150.29942.41
5.4.60.0100.26342.31
5.4.50.0130.22942.56
5.4.40.0150.29242.46
5.4.30.0130.30542.58
5.4.20.0160.28442.54
5.4.10.0200.29442.57
5.4.00.0250.29042.25
5.3.290.0170.29741.15
5.3.280.0130.30241.05
5.3.270.0320.27941.10
5.3.260.0170.30241.05
5.3.250.0170.28441.06
5.3.240.0100.32540.95
5.3.230.0230.26741.03
5.3.220.0220.29840.96
5.3.210.0230.27540.98
5.3.200.0120.28840.95
5.3.190.0170.29941.03
5.3.180.0130.26141.05
5.3.170.0150.27141.08
5.3.160.0150.26840.98
5.3.150.0150.32140.98
5.3.140.0150.29940.92
5.3.130.0120.30540.95
5.3.120.0120.27640.98
5.3.110.0280.29740.96
5.3.100.0350.28440.59
5.3.90.0220.28540.73
5.3.80.0100.31340.63
5.3.70.0150.29740.55
5.3.60.0120.29440.69
5.3.50.0130.31040.65
5.3.40.0230.31140.68
5.3.30.0150.29640.61
5.3.20.0170.28740.44
5.3.10.0170.29240.26
5.3.00.0170.28040.35
5.2.170.0070.27338.12
5.2.160.0230.29038.20
5.2.150.0130.30338.14
5.2.140.0170.30038.09
5.2.130.0130.29737.98
5.2.120.0600.26338.05
5.2.110.0100.28738.07
5.2.100.0230.30338.15
5.2.90.0130.33738.07
5.2.80.0230.26737.96
5.2.70.0170.27037.86
5.2.60.0070.31038.05
5.2.50.0170.33337.95
5.2.40.0170.30737.95
5.2.30.0200.27037.78
5.2.20.0070.26337.92
5.2.10.0130.24337.87
5.2.00.0030.25037.80
5.1.60.0270.30345.88
5.1.50.0170.30745.88
5.1.40.0130.31046.00
5.1.30.0130.35346.41
5.1.20.0200.32346.24
5.1.10.0100.30745.88
5.1.00.0130.29046.13
5.0.50.0200.35044.42
5.0.40.0130.37344.32
5.0.30.0130.41044.49
5.0.20.0070.35044.15
5.0.10.0130.35744.15
5.0.00.0170.37744.20
4.4.90.0100.33742.17
4.4.80.0170.44742.16
4.4.70.0030.32742.06
4.4.60.0170.33742.06
4.4.50.0100.34742.13
4.4.40.0170.37042.07
4.4.30.0170.37742.16
4.4.20.0130.32341.91
4.4.10.0230.33341.93
4.4.00.0200.38741.90
4.3.110.0270.35741.75
4.3.100.0130.32742.00
4.3.90.0170.34342.04
4.3.80.0130.40041.77
4.3.70.0200.36341.79
4.3.60.0170.37742.12
4.3.50.0200.34042.04
4.3.40.0230.32342.08
4.3.30.0100.31340.77
4.3.20.0130.55740.69
4.3.10.0170.58040.75
4.3.00.0130.54340.78

preferences:
39.89 ms | 401 KiB | 5 Q