3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 1000000; $arr = range(1,$max,3); $arr2 = range(1,$max,2); $arr = array_merge($arr,$arr2); $time = -microtime(true); $res1 = array_unique($arr); $time += microtime(true); echo "deduped to ".count($res1)." in ".$time; // deduped to 666667 in 32.300781965256 $time = -microtime(true); $res2 = array(); foreach($arr as $key=>$val) { $res2[$val] = true; } $res2 = array_keys($res2); $time += microtime(true); echo "<br />deduped to ".count($res2)." in ".$time; // deduped to 666667 in 0.84372591972351

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.0220.01639.78
7.4.00.0160.01939.71
7.3.130.0300.00739.79
7.3.120.0170.02039.53
7.3.110.0190.02239.74
7.3.100.0170.02040.03
7.3.90.0250.00939.94
7.3.80.0070.01739.62
7.3.70.0130.01639.96
7.3.60.0090.01639.63
7.3.50.0180.01039.49
7.3.40.0200.01339.72
7.3.30.0130.01639.89
7.3.20.0000.01644.63
7.3.10.0300.01444.42
7.3.00.0120.01444.38
7.2.260.0170.01740.27
7.2.250.0230.01739.93
7.2.240.0160.01340.22
7.2.230.0240.01440.36
7.2.220.0170.01739.93
7.2.210.0130.02340.00
7.2.200.0250.00440.28
7.2.190.0250.00440.06
7.2.180.0150.00940.00
7.2.170.0070.02340.16
7.2.160.0100.02140.05
7.2.150.0060.01244.76
7.2.140.0120.01244.60
7.2.130.0250.01144.53
7.2.120.0330.01744.49
7.2.110.0370.01244.55
7.2.100.0330.01444.59
7.2.90.0510.01244.70
7.2.80.0440.01144.73
7.2.70.0490.00844.65
7.2.60.0460.01144.43
7.2.50.0470.01344.55
7.2.40.0320.01644.64
7.2.30.0480.01744.69
7.2.20.0320.01744.49
7.2.10.0490.01244.68
7.2.00.0490.01444.89
7.1.330.0030.02455.72
7.1.320.0160.01355.60
7.1.310.0100.01455.90
7.1.300.0110.01455.70
7.1.290.0100.01055.38
7.1.280.0070.02055.61
7.1.270.0120.01255.59
7.1.260.0110.01555.74
7.1.250.0370.01455.54
7.1.240.0130.01355.53
7.1.230.0060.01255.57
7.1.220.0120.01655.54
7.1.210.0130.01055.81
7.1.200.0000.02455.34
7.1.190.0140.01155.46
7.1.180.0190.01055.64
7.1.170.0130.01355.47
7.1.160.0150.00455.77
7.1.150.0100.02055.63
7.1.140.0130.01655.56
7.1.130.0260.00355.82
7.1.120.0070.01155.74
7.1.110.0200.00355.43
7.1.100.0030.02055.62
7.1.90.0230.00055.86
7.1.80.0070.02055.80
7.1.70.0090.01256.45
7.1.60.0080.01556.52
7.1.50.0260.01744.25
7.1.40.0100.01755.64
7.1.30.0100.01755.64
7.1.20.0060.02355.72
7.1.10.0100.01355.69
7.1.00.0160.04859.00
7.0.330.0230.01359.52
7.0.320.0100.01759.46
7.0.310.0180.00959.54
7.0.300.0170.01059.01
7.0.290.0070.01859.35
7.0.280.0000.02359.24
7.0.270.0110.01159.41
7.0.260.0130.01659.23
7.0.250.0140.01159.43
7.0.240.0030.01959.41
7.0.230.0140.01059.27
7.0.220.0190.01959.24
7.0.210.0130.02259.47
7.0.200.0270.01559.83
7.0.190.0160.01059.05
7.0.180.0060.01659.16
7.0.170.0120.01259.41
7.0.160.0030.02159.52
7.0.150.0190.01259.22
7.0.140.0120.05062.79
7.0.130.0140.01059.25
7.0.120.0100.01359.36
7.0.110.0070.02259.48
7.0.100.0230.01359.18
7.0.90.0190.01359.48
7.0.80.0030.02059.39
7.0.70.0100.01759.53
7.0.60.0210.05860.22
7.0.50.0160.06059.28
7.0.40.0150.04059.30
7.0.30.0680.05159.15
7.0.20.0680.05359.26
7.0.10.0120.04060.68
7.0.00.0150.05559.27
5.6.400.0260.06278.73
5.6.390.0260.06978.89
5.6.380.0340.05878.80
5.6.370.0240.06578.43
5.6.360.0200.07078.64
5.6.350.0330.06078.97
5.6.340.0160.07878.75
5.6.330.0300.06078.80
5.6.320.0230.07378.44
5.6.310.0310.06278.46
5.6.300.0470.05878.68
5.6.290.0260.06979.07
5.6.280.0350.09682.14
5.6.270.0170.08678.41
5.6.260.0260.07978.63
5.6.250.0330.06678.81
5.6.240.0230.07379.04
5.6.230.0270.06678.93
5.6.220.0380.05278.89
5.6.210.0320.06581.93
5.6.200.0300.10580.82
5.6.190.0400.10381.80
5.6.180.0400.09381.96
5.6.170.0330.07881.78
5.6.160.0270.10781.64
5.6.150.0330.09680.68
5.6.140.0250.09280.78
5.6.130.0370.10380.85
5.6.120.0330.09582.01
5.6.110.0250.10982.21
5.6.100.0310.10881.99
5.6.90.0460.07882.23
5.6.80.0380.10081.88
5.6.70.2230.07481.87
5.6.60.0340.05778.60
5.6.50.0430.07778.63
5.6.40.0300.06278.71
5.6.30.0200.10178.73
5.6.20.0360.06678.58
5.6.10.0330.06078.66
5.6.00.0370.06178.46
5.5.380.0470.05778.40
5.5.370.0400.05378.57
5.5.360.0400.06378.56
5.5.350.0320.10281.77
5.5.340.0320.10280.55
5.5.330.0440.08681.53
5.5.320.0370.08781.64
5.5.310.0560.08681.70
5.5.300.0370.06580.50
5.5.290.0290.09480.53
5.5.280.0330.09882.03
5.5.270.0400.10781.89
5.5.260.0180.09182.00
5.5.250.0300.10582.00
5.5.240.0400.06781.56
5.5.230.0230.08478.57
5.5.220.0330.06278.41
5.5.210.0570.06478.79
5.5.200.0430.07278.33
5.5.190.0500.07078.61
5.5.180.0200.07578.70
5.5.170.0330.06778.17
5.5.160.0200.07678.54
5.5.150.0360.05678.71
5.5.140.0440.07178.67
5.5.130.0270.06678.40
5.5.120.0170.07878.51
5.5.110.0300.07078.75
5.5.100.0490.05378.59
5.5.90.0410.08178.82
5.5.80.0370.08078.80
5.5.70.0300.07478.32
5.5.60.0470.06778.46
5.5.50.0420.08278.41
5.5.40.0390.05678.51
5.5.30.0300.06078.20
5.5.20.0360.06978.59
5.5.10.0260.07378.79
5.5.00.0410.05878.66
5.4.450.0920.10279.39
5.4.440.0850.10379.77
5.4.430.0810.09179.70
5.4.420.1300.02279.46
5.4.410.0560.10679.38
5.4.400.0440.09479.26
5.4.390.0380.09679.12
5.4.380.0460.10179.28
5.4.370.0650.07579.15
5.4.360.0400.08279.28
5.4.350.0280.07975.90
5.4.340.0230.09075.88
5.4.330.0370.05075.22
5.4.320.0330.07176.24
5.4.310.0420.07776.16
5.4.300.0190.08676.18
5.4.290.0200.08076.12
5.4.280.0290.07676.13
5.4.270.0280.07576.04
5.4.260.0310.07276.10
5.4.250.0310.07475.96
5.4.240.0280.07676.09
5.4.230.0210.07976.14
5.4.220.0200.07676.04
5.4.210.0270.08376.03
5.4.200.0500.09476.15
5.4.190.0530.08876.00
5.4.180.0600.09575.97
5.4.170.0530.07976.20
5.4.160.0640.09776.19
5.4.150.0490.09575.95
5.4.140.0500.09075.91
5.4.130.0520.07975.90
5.4.120.0500.08575.96
5.4.110.0500.08275.88
5.4.100.0670.10075.94
5.4.90.0560.08275.91
5.4.80.0500.08776.00
5.4.70.0750.09475.83
5.4.60.0710.10675.79
5.4.50.0500.08475.96
5.4.40.0580.07375.84
5.4.30.0590.09475.87
5.4.20.0640.11175.92
5.4.10.0920.09275.88
5.4.00.0550.09775.57
5.3.290.0320.08374.78
5.3.280.0250.08274.60
5.3.270.0450.09074.70
5.3.260.0510.08574.73
5.3.250.0500.08874.64
5.3.240.0510.08974.66
5.3.230.0600.10974.59
5.3.220.0490.07874.67
5.3.210.0510.08474.62
5.3.200.0530.09174.65
5.3.190.0460.09674.68
5.3.180.0610.11874.74
5.3.170.0600.08674.73
5.3.160.0500.09274.72
5.3.150.0480.08474.70
5.3.140.0520.08074.70
5.3.130.0640.09974.60
5.3.120.0440.09374.56
5.3.110.0500.08574.66
5.3.100.0500.08874.31
5.3.90.0620.10574.41
5.3.80.0520.10474.31
5.3.70.0510.08874.29
5.3.60.0460.10174.38
5.3.50.0480.08874.27
5.3.40.0620.09474.27
5.3.30.0550.10574.16
5.3.20.0440.08374.12
5.3.10.0500.08674.04
5.3.00.0480.08474.04
5.2.170.0640.09773.04
5.2.160.0890.13173.04
5.2.150.0630.09873.04
5.2.140.0810.08473.04
5.2.130.0670.09473.00
5.2.120.0860.11273.00
5.2.110.0660.10173.00
5.2.100.0930.13173.00
5.2.90.0640.10673.00
5.2.80.0810.08272.99
5.2.70.0860.13572.99
5.2.60.0680.09272.95
5.2.50.0810.17370.60
5.2.40.0680.12970.58
5.2.30.0730.12270.54
5.2.20.0650.13270.55
5.2.10.0660.09070.46
5.2.00.2032.243275.88
5.1.60.2102.303351.60
5.1.50.1602.347351.55
5.1.40.1932.313351.56
5.1.30.2032.303351.76
5.1.20.1702.333351.84
5.1.10.2032.270351.57
5.1.00.0150.0278.12
5.0.50.2102.277350.06
5.0.40.1972.310349.92
5.0.30.2232.243349.75
5.0.20.2302.280349.77
5.0.10.1832.307349.72
5.0.00.2032.320349.60
4.4.90.0170.0394.78
4.4.80.0070.0184.75
4.4.70.0080.0184.75
4.4.60.0090.0174.75
4.4.50.0070.0184.77
4.4.40.0100.0264.71
4.4.30.0150.0414.75
4.4.20.0070.0194.84
4.4.10.0080.0184.85
4.4.00.0110.0254.76
4.3.110.0100.0154.66
4.3.100.0070.0184.66
4.3.90.0120.0154.64
4.3.80.0070.0294.59
4.3.70.0120.0144.63
4.3.60.0090.0174.63
4.3.50.0110.0184.62
4.3.40.0100.0284.54
4.3.30.0070.0183.34
4.3.20.0030.0213.32
4.3.10.0070.0183.29
4.3.00.0130.0236.24

preferences:
36.21 ms | 401 KiB | 5 Q