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 (isset($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.0030.77319.15
7.1.70.0100.83617.15
7.1.60.0030.73019.46
7.1.50.0030.74516.84
7.1.00.0070.83022.44
7.0.200.0470.77014.95
7.0.140.0030.88322.09
7.0.60.0170.81019.84
7.0.50.0000.74717.82
7.0.40.0000.73019.98
7.0.30.0100.71720.02
7.0.20.0270.77320.00
7.0.10.0130.85020.19
7.0.00.0070.82720.17
5.6.280.0030.87020.92
5.6.210.0130.89020.70
5.6.200.0100.84718.18
5.6.190.0070.81720.60
5.6.180.0300.78320.35
5.6.170.0270.86720.41
5.6.160.0070.80720.51
5.6.150.0030.82018.22
5.6.140.0070.90318.22
5.6.130.0100.86018.11
5.6.120.0100.86321.16
5.6.110.0200.81021.11
5.6.100.0170.81321.01
5.6.90.0030.78020.97
5.6.80.0030.87020.44
5.5.350.0100.98020.38
5.5.340.0070.86717.99
5.5.330.0070.80720.21
5.5.320.0430.82020.27
5.5.310.0200.75320.24
5.5.300.0100.83717.91
5.5.290.0070.80017.92
5.5.280.0070.81320.76
5.5.270.0030.88020.76
5.5.260.0100.81720.87
5.5.250.0030.75720.70
5.5.240.0170.83020.19
5.4.450.0730.95319.55
5.4.440.0201.11019.45
5.4.430.0331.18319.52
5.4.420.0201.30019.56
5.4.410.0431.26019.08
5.4.400.0471.01719.09
5.4.390.0131.13318.93
5.4.380.0331.30318.71
5.4.370.0131.32018.56
5.4.360.0301.28718.46
5.4.350.0401.35018.82
5.4.340.0601.60718.46
5.4.320.0071.00812.46
5.4.310.0060.97012.46
5.4.300.0050.90612.46
5.4.290.0080.94812.46
5.4.280.0070.88812.36
5.4.270.0060.88012.36
5.4.260.0050.88212.36
5.4.250.0100.88712.36
5.4.240.0090.96412.36
5.4.230.0070.88412.35
5.4.220.0090.92512.35
5.4.210.0060.95312.35
5.4.200.0130.87912.35
5.4.190.0080.91512.35
5.4.180.0090.90412.35
5.4.170.0060.93012.36
5.4.160.0060.85512.36
5.4.150.0070.88612.35
5.4.140.0040.86212.03
5.4.130.0030.85912.02
5.4.120.0030.94211.98
5.4.110.0080.92111.97
5.4.100.0100.97911.98
5.4.90.0030.91811.98
5.4.80.0030.90111.98
5.4.70.0040.89911.97
5.4.60.0100.87511.97
5.4.50.0060.88911.97
5.4.40.0041.00211.96
5.4.30.0120.97911.96
5.4.20.0050.90211.95
5.4.10.0080.88611.95
5.4.00.0140.90411.45
5.3.290.0180.99312.80
5.3.280.0090.92512.71
5.3.270.0110.95912.73
5.3.260.0120.95312.72
5.3.250.0100.98512.72
5.3.240.0081.05912.72
5.3.230.0100.91012.71
5.3.220.0100.95912.68
5.3.210.0071.01812.68
5.3.200.0131.07712.68
5.3.190.0121.00312.68
5.3.180.0100.93012.67
5.3.170.0070.94112.67
5.3.160.0071.02112.67
5.3.150.0050.95712.68
5.3.140.0130.95512.66
5.3.130.0070.98112.66
5.3.120.0060.97112.66
5.3.110.0081.07812.66
5.3.100.0111.02012.12
5.3.90.0051.07712.08
5.3.80.0090.91712.07
5.3.70.0050.92112.07
5.3.60.0110.93912.06
5.3.50.0050.99012.00
5.3.40.0070.94312.00
5.3.30.0121.04611.96
5.3.20.0140.92411.74
5.3.10.0081.04311.70
5.3.00.0101.00511.69
5.2.170.0121.0869.20
5.2.160.0091.0789.20
5.2.150.0091.2259.20
5.2.140.0081.1539.19
5.2.130.0110.9629.16
5.2.120.0070.9969.15
5.2.110.0121.0849.16
5.2.100.0060.9789.16
5.2.90.0101.1609.16
5.2.80.0021.0119.15
5.2.70.0050.9709.15
5.2.60.0081.0909.10
5.2.50.0040.9869.07
5.2.40.0091.0259.05
5.2.30.0080.9489.03
5.2.20.0110.9929.01
5.2.10.0060.9608.97
5.2.00.0070.9768.83
5.1.60.0100.9528.11
5.1.50.0120.9448.11
5.1.40.0090.9958.09
5.1.30.0111.1408.44
5.1.20.0041.2078.46
5.1.10.0071.1138.18
5.1.00.0061.1038.19
5.0.50.0051.1776.67
5.0.40.0041.1276.53
5.0.30.0081.0376.34
5.0.20.0051.0296.31
5.0.10.0051.0506.29
5.0.00.0091.0406.28
4.4.90.0081.3184.78
4.4.80.0081.1754.75
4.4.70.0101.1854.76
4.4.60.0041.2594.75
4.4.50.0051.1244.77
4.4.40.0051.2094.71
4.4.30.0061.2634.75
4.4.20.0051.1894.84
4.4.10.0051.1704.85
4.4.00.0061.2934.76
4.3.110.0060.6834.67
4.3.100.0061.3224.66
4.3.90.0081.3084.64
4.3.80.0061.4024.59
4.3.70.0051.3394.63
4.3.60.0071.3454.63
4.3.50.0041.2704.63
4.3.40.0041.4184.54
4.3.30.0111.3163.36
4.3.20.0041.3253.33
4.3.10.0031.2833.28
4.3.00.0401.20015.00

preferences:
38.39 ms | 401 KiB | 5 Q