3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $start = microtime(true); for($i = 0; $i < 10000; $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 < 10000; $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.3.10.0100.01316.66
7.3.00.0060.01816.57
7.2.130.0070.01416.86
7.2.120.0070.02016.65
7.2.110.0090.01516.79
7.2.100.0130.01616.79
7.2.90.0040.01516.68
7.2.80.0120.01616.64
7.2.70.0130.02316.78
7.2.60.0130.01316.82
7.2.50.0090.01616.83
7.2.40.0070.01816.89
7.2.30.0130.01616.68
7.2.20.0030.02316.74
7.2.10.0160.01216.73
7.2.00.0060.02018.13
7.1.250.0090.01915.74
7.1.240.0120.01215.64
7.1.230.0100.01615.91
7.1.220.0030.02315.89
7.1.210.0030.02315.39
7.1.200.0070.01815.57
7.1.190.0000.02915.40
7.1.180.0090.01615.65
7.1.170.0070.02615.63
7.1.160.0100.02015.50
7.1.150.0030.02115.71
7.1.140.0030.02015.43
7.1.130.0030.01715.77
7.1.120.0100.01615.66
7.1.110.0130.02315.92
7.1.100.0110.01815.44
7.1.90.0000.02015.64
7.1.80.0070.02115.47
7.1.70.0050.01316.33
7.1.60.0150.02217.47
7.1.50.0080.02716.11
7.1.40.0100.01615.90
7.1.30.0000.02215.21
7.1.20.0120.01515.39
7.1.10.0100.02115.47
7.1.00.0030.05818.93
7.0.330.0060.01915.39
7.0.320.0040.02215.23
7.0.310.0070.01715.22
7.0.300.0060.01915.13
7.0.290.0100.01714.99
7.0.280.0040.02215.08
7.0.270.0070.02115.52
7.0.260.0070.01815.33
7.0.250.0030.02215.25
7.0.240.0030.02115.17
7.0.230.0030.01815.01
7.0.220.0170.01415.35
7.0.210.0030.02415.50
7.0.200.0430.01614.95
7.0.190.0040.01815.24
7.0.180.0030.02615.11
7.0.170.0110.02215.53
7.0.160.0090.01815.23
7.0.150.0060.01315.25
7.0.140.0030.05518.67
7.0.130.0030.02215.36
7.0.120.0110.01815.06
7.0.110.0050.03317.61
7.0.100.0030.03517.78
7.0.90.0100.05117.51
7.0.80.0130.04917.64
7.0.70.0070.06117.41
7.0.60.0110.03817.68
7.0.50.0150.04817.52
7.0.40.0160.05116.67
7.0.30.0120.05016.48
7.0.20.0140.03916.32
7.0.10.0030.04516.45
7.0.00.0090.05216.55
5.6.380.0070.02014.25
5.6.370.0030.02414.07
5.6.360.0000.02014.36
5.6.350.0080.01514.21
5.6.340.0030.02714.34
5.6.330.0060.01914.30
5.6.320.0040.02514.09
5.6.310.0130.02514.38
5.6.300.0030.02414.34
5.6.290.0070.02413.89
5.6.280.0050.05617.54
5.6.270.0000.02414.38
5.6.260.0050.03417.33
5.6.250.0090.03417.51
5.6.240.0080.03717.40
5.6.230.0070.05717.46
5.6.220.0090.05817.46
5.6.210.0130.05517.34
5.6.200.0070.06017.39
5.6.190.0050.05717.46
5.6.180.0100.04317.33
5.6.170.0080.05517.32
5.6.160.0120.04917.46
5.6.150.0120.05917.35
5.6.140.0170.05117.57
5.6.130.0050.06017.27
5.6.120.0070.05417.17
5.6.110.0150.06217.29
5.6.100.0120.05517.39
5.6.90.0070.05417.27
5.6.80.0070.05417.17
5.6.70.0160.04616.97
5.6.60.0080.05517.01
5.6.50.0070.05916.86
5.6.40.0070.05516.98
5.6.30.0080.03917.06
5.6.20.0080.05517.25
5.6.10.0130.04517.04
5.6.00.0030.05217.09
5.5.380.0150.05115.68
5.5.370.0120.05815.83
5.5.360.0100.05415.54
5.5.350.0080.04815.69
5.5.340.0080.05515.72
5.5.330.0100.06315.96
5.5.320.0160.03615.92
5.5.310.0050.05215.92
5.5.300.0080.04216.02
5.5.290.0070.05315.99
5.5.280.0000.05515.89
5.5.270.0080.05416.05
5.5.260.0020.05315.87
5.5.250.0020.05715.85
5.5.240.0070.05315.70
5.5.230.0070.05715.36
5.5.220.0060.04615.71
5.5.210.0080.05315.56
5.5.200.0070.04015.56
5.5.190.0050.05915.47
5.5.180.0120.04215.70
5.5.170.0030.02910.46
5.5.160.0050.05515.69
5.5.150.0050.05615.66
5.5.140.0120.05415.73
5.5.130.0070.05315.55
5.5.120.0100.03715.57
5.5.110.0060.05615.42
5.5.100.0070.05515.58
5.5.90.0070.05615.40
5.5.80.0080.05115.59
5.5.70.0070.05815.54
5.5.60.0050.04815.62
5.5.50.0100.04715.44
5.5.40.0060.04115.48
5.5.30.0090.04915.69
5.5.20.0050.05315.50
5.5.10.0080.05215.55
5.5.00.0140.04915.63
5.4.450.0050.05515.07
5.4.440.0030.05115.21
5.4.430.0080.05515.21
5.4.420.0030.04115.06
5.4.410.0070.05014.97
5.4.400.0080.04514.88
5.4.390.0100.05014.81
5.4.380.0050.05014.97
5.4.370.0070.05514.86
5.4.360.0080.05414.97
5.4.350.0080.05014.97
5.4.340.0030.05614.90
5.4.330.0040.02610.56
5.4.320.0030.05715.08
5.4.310.0080.05414.91
5.4.300.0120.04614.78
5.4.290.0030.06314.92
5.4.280.0060.05414.95
5.4.270.0100.04814.77
5.4.260.0100.05014.89
5.4.250.0030.05515.04
5.4.240.0050.05415.07
5.4.230.0030.03915.00
5.4.220.0050.05514.97
5.4.210.0020.06014.86
5.4.200.0130.04914.89
5.4.190.0050.04815.09
5.4.180.0110.04414.80
5.4.170.0070.05415.09
5.4.160.0080.05114.89
5.4.150.0070.06214.82
5.4.140.0050.05713.53
5.4.130.0030.05513.55
5.4.120.0070.05213.63
5.4.110.0020.05913.51
5.4.100.0080.03313.38
5.4.90.0050.06013.63
5.4.80.0000.05913.66
5.4.70.0050.05613.53
5.4.60.0080.05713.61
5.4.50.0050.04013.57
5.4.40.0050.05513.68
5.4.30.0070.04913.49
5.4.20.0080.05713.42
5.4.10.0100.05613.39
5.4.00.0070.05213.37
5.3.290.0030.05712.67
5.3.280.0030.05512.43
5.3.270.0070.05412.59
5.3.260.0020.06212.50
5.3.250.0100.04812.51
5.3.240.0050.05412.37
5.3.230.0080.04912.49
5.3.220.0050.05412.45
5.3.210.0030.05712.44
5.3.200.0070.05612.49
5.3.190.0070.05412.45
5.3.180.0070.05412.58
5.3.170.0030.05512.55
5.3.160.0080.04512.59
5.3.150.0100.05212.55
5.3.140.0070.05812.37
5.3.130.0060.05512.41
5.3.120.0060.05712.46
5.3.110.0100.05412.47
5.3.100.0080.05612.19
5.3.90.0070.05412.19
5.3.80.0060.05612.16
5.3.70.0050.05712.19
5.3.60.0050.05512.31
5.3.50.0100.04912.16
5.3.40.0070.05312.19
5.3.30.0100.04612.22
5.3.20.0050.03411.98
5.3.10.0070.05211.96
5.3.00.0080.05711.96
5.2.170.0050.04810.82
5.2.160.0020.04110.82
5.2.150.0070.03110.83
5.2.140.0080.04310.77
5.2.130.0030.04910.60
5.2.120.0070.05010.65
5.2.110.0090.04710.68
5.2.100.0020.05010.70
5.2.90.0020.05010.64
5.2.80.0050.05210.58
5.2.70.0050.05010.73
5.2.60.0070.05010.55
5.2.50.0050.05010.67
5.2.40.0110.04310.79
5.2.30.0050.04510.57
5.2.20.0050.05210.67
5.2.10.0020.05610.54
5.2.00.0110.03610.59
5.1.60.0030.03810.30
5.1.50.0070.04510.32
5.1.40.0070.04210.35
5.1.30.0020.04710.47
5.1.20.0050.04310.32
5.1.10.0080.04310.34
5.1.00.0030.05010.27
5.0.50.0050.0339.89
5.0.40.0040.0429.89
5.0.30.0050.0439.89
5.0.20.0030.0429.89
5.0.10.0110.0329.89
5.0.00.0030.0559.89
4.4.90.0020.0379.89
4.4.80.0050.0349.89
4.4.70.0070.0339.89
4.4.60.0030.0379.89
4.4.50.0030.0389.89
4.4.40.0070.0459.89
4.4.30.0050.0339.89
4.4.20.0050.0379.89
4.4.10.0060.0369.89
4.4.00.0030.0459.89
4.3.110.0020.0219.89
4.3.100.0030.0379.89
4.3.90.0050.0379.89
4.3.80.0050.0449.89
4.3.70.0070.0409.89
4.3.60.0070.0339.89
4.3.50.0090.0349.89
4.3.40.0000.0479.89
4.3.30.0030.0439.89
4.3.20.0000.0449.89
4.3.10.0030.0359.89
4.3.00.0030.0419.89

preferences:
34.95 ms | 401 KiB | 5 Q