3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = $arr2 = []; $count = 1000000; for ($i = $count; $i >= 0; --$i) { $arr[$i] = rand(0, PHP_INT_MAX); } for ($i = $count / 10000; $i >= 0; --$i) { $arr2[ rand(0, PHP_INT_MAX) ] = true; } $t = microtime(true); $arr = array_flip($arr); $result = array_intersect_key($arr2, $arr); var_dump(microtime(true) - $t);

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.0620.10955.70
7.3.120.0350.10255.37
7.3.110.0570.11055.64
7.3.100.0530.10355.94
7.3.90.0560.09555.97
7.3.80.0600.10155.74
7.3.70.0400.10655.93
7.3.60.0400.09755.64
7.3.50.0500.09055.74
7.3.40.0430.08255.73
7.3.30.0510.10555.09
7.3.20.2590.07758.74
7.3.10.2230.08258.20
7.3.00.2580.07558.61
7.2.250.0460.08951.11
7.2.240.0470.13451.68
7.2.230.0360.08351.35
7.2.220.0360.11351.43
7.2.210.0420.08451.49
7.2.200.0740.09451.31
7.2.190.0500.11751.65
7.2.180.0430.09651.46
7.2.170.0410.09251.13
7.2.00.2750.05355.49
7.1.330.0200.16454.02
7.1.320.0200.16953.88
7.1.310.0300.17853.42
7.1.300.0200.14653.96
7.1.290.0270.16053.84
7.1.280.0170.15153.57
7.1.270.2530.16353.60
7.1.260.2560.14753.74
7.1.70.0400.11955.13
7.1.60.0200.15755.44
7.1.50.0200.14254.94
7.1.00.0070.19360.35
7.0.200.0790.08954.82
7.0.140.0070.17359.97
7.0.120.0130.19060.00
7.0.110.0070.19060.16
7.0.100.0200.16360.04
7.0.90.0070.18060.05
7.0.80.0070.19360.13
7.0.70.0070.18760.10
7.0.60.0070.18760.00
7.0.50.0100.18060.21
7.0.40.0030.19059.96
7.0.30.0130.17060.20
7.0.20.0170.14360.10
7.0.10.0070.18360.20
7.0.00.0070.13059.96
5.6.280.0130.22385.75
5.6.260.0300.20785.48
5.6.250.0170.20385.47
5.6.240.0270.20085.44
5.6.230.0230.21085.43
5.6.220.0270.20785.46
5.6.210.0230.21785.69
5.6.200.0230.21385.73
5.6.190.0170.22385.72
5.6.180.0330.21385.47
5.6.170.0130.21785.58
5.6.160.0270.20385.63
5.6.150.0270.21085.68
5.6.140.0330.21085.57
5.6.130.0130.17785.71
5.6.120.0200.21385.61
5.6.110.0130.20385.47
5.6.100.0200.21785.67
5.6.90.0130.21385.47
5.6.80.0100.22384.95
5.6.70.0130.21785.06
5.6.60.0170.18085.09
5.6.50.0370.18085.11
5.6.40.0170.21084.75
5.6.30.0230.21085.03
5.6.20.0170.21385.07
5.6.10.0330.19784.99
5.6.00.0400.19385.03
5.5.380.0070.23382.08
5.5.370.0270.22082.18
5.5.360.0430.19082.24
5.5.350.0270.21082.07
5.5.340.0270.21782.39
5.5.330.0330.21082.47
5.5.320.0270.14782.69
5.5.310.0270.21382.65
5.5.300.0230.21382.46
5.5.290.0170.16382.70
5.5.280.0170.22082.68
5.5.270.0300.20782.46
5.5.260.0230.21782.68
5.5.250.0200.21782.43
5.5.240.0200.22082.12
5.5.230.0130.22381.83
5.5.220.0200.22082.02
5.5.210.0130.22382.08
5.5.200.0030.23081.98
5.5.190.0230.21381.82
5.5.180.0170.22782.09
5.5.160.0230.19781.84
5.5.150.0230.21381.82
5.5.140.0400.19782.09
5.5.130.0330.18782.00
5.5.120.0270.21082.03
5.5.110.0100.15781.81
5.5.100.0130.22081.88
5.5.90.0100.21781.72
5.5.80.0270.21781.93
5.5.70.0270.19781.75
5.5.60.0300.20081.99
5.5.50.0170.20781.89
5.5.40.0270.16081.89
5.5.30.0170.20781.94
5.5.20.0270.20381.67
5.5.10.0270.20781.70
5.5.00.0170.22381.68
5.4.450.0330.18384.21
5.4.440.0170.19783.86
5.4.430.0270.20783.89
5.4.420.0300.20084.17
5.4.410.0130.21783.83
5.4.400.0130.21383.69
5.4.390.0130.22083.59
5.4.380.0170.22383.55
5.4.370.0300.18383.55
5.4.360.0200.21783.60
5.4.350.0130.21383.56
5.4.340.0130.22083.58
5.4.320.0200.16783.85
5.4.310.0230.20783.58
5.4.300.0200.21783.55
5.4.290.0170.21783.84
5.4.280.0200.21783.66
5.4.270.0300.20083.67
5.4.260.0170.21383.56
5.4.250.0400.19783.55
5.4.240.0200.21083.48
5.4.230.0100.22383.57
5.4.220.0170.21383.50
5.4.210.0230.20783.59
5.4.200.0330.19383.66
5.4.190.0270.20783.49
5.4.180.0430.13083.55
5.4.170.0270.21783.59
5.4.160.0430.19083.43
5.4.150.0170.21783.82
5.4.140.0370.19780.95
5.4.130.0370.19080.99
5.4.120.0130.13381.08
5.4.110.0100.20780.80
5.4.100.0130.13780.98
5.4.90.0100.21781.02
5.4.80.0230.12780.73
5.4.70.0130.13781.02
5.4.60.0230.12781.00
5.4.50.0030.14780.82
5.4.40.0030.22081.11
5.4.30.0170.21780.97
5.4.20.0170.21381.00
5.4.10.0100.22380.95
5.4.00.0230.15780.32
5.3.290.0000.07314.45
5.3.280.0030.05714.48
5.3.270.0000.07314.39
5.3.260.0000.07314.61
5.3.250.0000.06714.62
5.3.240.0030.06714.43
5.3.230.0030.03314.66
5.3.220.0070.03014.50
5.3.210.0000.03714.51
5.3.200.0000.03314.41
5.3.190.0030.03314.51
5.3.180.0030.03314.43
5.3.170.0000.03714.45
5.3.160.0000.03714.63
5.3.150.0000.03314.43
5.3.140.0000.07014.50
5.3.130.0070.06714.55
5.3.120.0070.06714.41
5.3.110.0000.07014.44
5.3.100.0030.06713.96
5.3.90.0000.06713.93
5.3.80.0070.06014.02
5.3.70.0030.06313.95
5.3.60.0070.06013.79
5.3.50.0000.06714.04
5.3.40.0030.06713.83
5.3.30.0000.06713.93
5.3.20.0000.06713.61
5.3.10.0030.06013.66
5.3.00.0100.05313.64
5.2.170.0000.06013.05
5.2.160.0030.05013.05
5.2.150.0070.05013.05
5.2.140.0030.05313.05
5.2.130.0030.05013.05
5.2.120.0070.04713.05
5.2.110.0070.04013.05
5.2.100.0030.05013.05
5.2.90.0030.05013.05
5.2.80.0000.05713.05
5.2.70.0000.05713.05
5.2.60.0070.05013.05
5.2.50.0000.05013.05
5.2.40.0030.05313.05
5.2.30.0030.05313.05
5.2.20.0030.05313.05
5.2.10.0070.05013.05
5.2.00.0070.04713.05
5.1.60.0030.04313.05
5.1.50.0000.05013.05
5.1.40.0070.04313.05
5.1.30.0000.05013.05
5.1.20.0030.05013.05
5.1.10.0030.04713.05
5.1.00.0000.05013.05
5.0.50.0000.04313.05
5.0.40.0070.03313.05
5.0.30.0030.05713.05
5.0.20.0000.04013.05
5.0.10.0000.04013.05
5.0.00.0000.05713.05
4.4.90.0030.03013.05
4.4.80.0070.03013.05
4.4.70.0030.02713.05
4.4.60.0030.02713.05
4.4.50.0000.03013.05
4.4.40.0030.04713.05
4.4.30.0000.03013.05
4.4.20.0000.03013.05
4.4.10.0000.03013.05
4.4.00.0000.04713.05
4.3.110.0000.03313.05
4.3.100.0000.03013.05
4.3.90.0030.02713.05
4.3.80.0000.04713.05
4.3.70.0030.02713.05
4.3.60.0000.02713.05
4.3.50.0000.03313.05
4.3.40.0000.04313.05
4.3.30.0000.03313.05
4.3.20.0000.03313.05
4.3.10.0000.03313.05
4.3.00.0070.02313.05

preferences:
34.5 ms | 400 KiB | 5 Q