3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $amount = 1000000; $start = microtime(true); for($i = 0; $i < $amount ; $i++) { $alreadyOutput = array(); foreach ($results as $result) { if(in_array($result->date, $alreadyOutput)){ continue; } $alreadyOutput[] = $result->date; echo $result->date . "<br />"; } } echo "in_array: ".(microtime(true) - $start)."ms || "; $start2 = microtime(true); for($i = 0; $i < $amount ; $i++) { $echoedArray = array(); foreach ($results as $result) { if ($echoedArray[$result->date]) { continue; } echo $result->date . "<br />"; $echoedArray[$result->date] = true; } } echo "by key: ".(microtime(true) - $start2)."ms";

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.2.00.0000.78119.38
7.1.70.0030.75517.19
7.1.60.0130.71719.46
7.1.50.0170.74016.93
7.1.00.0000.95322.45
7.0.200.0130.72314.94
7.0.140.0000.86722.00
7.0.60.0070.75319.91
7.0.50.0030.71717.88
7.0.40.0030.72719.98
7.0.30.0400.71720.00
7.0.20.0300.78020.18
7.0.10.0100.84320.18
7.0.00.0030.79319.99
5.6.280.0031.12021.11
5.6.210.0130.87020.55
5.6.200.0070.82318.09
5.6.190.0070.85020.56
5.6.180.0400.83320.59
5.6.170.1800.81320.45
5.6.160.0030.82020.38
5.6.150.0130.85718.21
5.6.140.0170.85718.28
5.6.130.0030.78718.14
5.6.120.0100.91021.10
5.6.110.0070.84721.09
5.6.100.0170.82021.02
5.6.90.0030.95321.13
5.6.80.0100.86720.36
5.5.350.0230.87020.41
5.5.340.0030.81317.93
5.5.330.0000.82720.36
5.5.320.0470.81720.27
5.5.310.0230.81020.29
5.5.300.0030.77717.91
5.5.290.0100.77717.87
5.5.280.0000.87320.80
5.5.270.0130.85720.83
5.5.260.0200.81720.68
5.5.250.0070.78720.56
5.5.240.0300.81720.19
5.4.450.0071.31019.42
5.4.440.0170.91019.41
5.4.430.0671.12319.45
5.4.420.0331.13319.10
5.4.410.0671.13318.97
5.4.400.0801.12019.08
5.4.390.0671.12719.16
5.4.380.0601.41718.64
5.4.370.0231.43718.51
5.4.360.0231.58318.70
5.4.350.0371.28018.48
5.4.340.0571.29718.51
5.4.320.0130.98712.46
5.4.310.0100.97612.46
5.4.300.0120.90212.46
5.4.290.0080.93012.46
5.4.280.0070.88112.36
5.4.270.0080.88912.36
5.4.260.0080.89312.36
5.4.250.0100.86512.36
5.4.240.0100.94612.36
5.4.230.0120.98012.35
5.4.220.0180.88812.35
5.4.210.0060.93912.35
5.4.200.0050.87312.35
5.4.190.0080.95612.35
5.4.180.0100.97612.35
5.4.170.0090.98112.36
5.4.160.0100.90112.36
5.4.150.0090.92712.35
5.4.140.0090.89312.03
5.4.130.0100.96312.02
5.4.120.0070.95511.98
5.4.110.0110.99711.98
5.4.100.0060.97811.98
5.4.90.0050.90411.98
5.4.80.0120.90011.98
5.4.70.0090.93711.97
5.4.60.0101.07111.97
5.4.50.0090.89511.97
5.4.40.0070.90911.96
5.4.30.0040.88511.96
5.4.20.0060.92111.96
5.4.10.0100.92311.96
5.4.00.0110.95111.45
5.3.290.0141.07312.80
5.3.280.0131.04012.71
5.3.270.0030.98312.72
5.3.260.0090.96612.72
5.3.250.0070.92612.72
5.3.240.0070.96212.72
5.3.230.0071.00812.71
5.3.220.0120.93312.68
5.3.210.0140.99212.68
5.3.200.0060.94712.68
5.3.190.0100.96312.68
5.3.180.0070.98912.67
5.3.170.0101.04112.67
5.3.160.0090.97112.67
5.3.150.0050.92712.67
5.3.140.0130.97012.66
5.3.130.0060.94012.66
5.3.120.0100.94712.66
5.3.110.0110.95412.66
5.3.100.0081.04312.12
5.3.90.0120.92012.09
5.3.80.0110.93812.07
5.3.70.0100.91312.07
5.3.60.0070.94712.07
5.3.50.0070.98112.00
5.3.40.0070.92512.00
5.3.30.0081.09411.96
5.3.20.0050.93511.74
5.3.10.0140.97611.70
5.3.00.0090.91211.69
5.2.170.0060.9739.20
5.2.160.0061.0489.20
5.2.150.0091.0639.20
5.2.140.0051.1909.20
5.2.130.0071.0269.15
5.2.120.0080.9909.16
5.2.110.0041.0549.16
5.2.100.0070.9719.16
5.2.90.0051.1609.16
5.2.80.0060.9809.15
5.2.70.0091.0059.16
5.2.60.0050.9919.10
5.2.50.0071.0639.07
5.2.40.0050.9849.05
5.2.30.0040.9959.03
5.2.20.0070.9939.01
5.2.10.0050.9478.97
5.2.00.0090.9598.83
5.1.60.0030.9238.11
5.1.50.0060.9598.11
5.1.40.0040.9278.09
5.1.30.0101.0018.44
5.1.20.0071.1058.46
5.1.10.0040.9498.18
5.1.00.0161.0698.18
5.0.50.0031.0936.67
5.0.40.0081.0986.53
5.0.30.0071.1176.34
5.0.20.0081.0666.30
5.0.10.0071.1116.29
5.0.00.0011.0466.28
4.4.90.0081.2254.78
4.4.80.0071.1694.75
4.4.70.0071.2044.75
4.4.60.0131.2704.75
4.4.50.0051.1184.77
4.4.40.0061.2844.71
4.4.30.0081.2414.76
4.4.20.0051.1984.84
4.4.10.0081.2174.85
4.4.00.0021.3374.76
4.3.110.0030.6934.67
4.3.100.0111.3054.66
4.3.90.0051.3654.63
4.3.80.0011.4094.59
4.3.70.0031.3374.63
4.3.60.0041.5164.62
4.3.50.0041.2904.63
4.3.40.0051.4314.55
4.3.30.0071.3153.35
4.3.20.0071.3803.33
4.3.10.0081.2823.29
4.3.00.0131.23015.00

preferences:
37.08 ms | 401 KiB | 5 Q