3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $start = microtime(true); for($i = 0; $i < 1000; $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 < 1000; $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.4.10.0090.00614.94
7.4.00.0050.01514.86
7.3.130.0110.01114.88
7.3.120.0100.01014.98
7.3.110.0050.01415.07
7.3.100.0050.01115.02
7.3.90.0050.01514.91
7.3.80.0060.01114.75
7.3.70.0020.01114.95
7.3.60.0070.00714.88
7.3.50.0040.01114.78
7.3.40.0080.00814.79
7.3.30.0030.01514.93
7.3.20.0050.01116.68
7.3.10.0060.00616.57
7.3.00.0090.00616.59
7.2.260.0030.01714.96
7.2.250.0090.01115.11
7.2.240.0110.00914.87
7.2.230.0060.00914.98
7.2.220.0070.01314.81
7.2.210.0100.00814.96
7.2.200.0080.00814.87
7.2.190.0080.00815.10
7.2.180.0080.00815.14
7.2.170.0030.01015.07
7.2.160.0030.01214.71
7.2.150.0120.00316.92
7.2.140.0140.00016.71
7.2.130.0060.00917.02
7.2.120.0120.00316.95
7.2.110.0070.00717.04
7.2.100.0040.01116.65
7.2.90.0000.01716.93
7.2.80.0030.00916.95
7.2.70.0090.00617.04
7.2.60.0030.01316.76
7.2.50.0060.00916.89
7.2.40.0030.01317.04
7.2.30.0040.01217.07
7.2.20.0040.01116.92
7.2.10.0090.00617.01
7.2.00.0050.01017.96
7.1.330.0090.00915.70
7.1.320.0070.01015.66
7.1.310.0030.01315.66
7.1.300.0050.01015.85
7.1.290.0030.01015.69
7.1.280.0050.00815.67
7.1.270.0080.00915.59
7.1.260.0020.01315.79
7.1.250.0070.01015.82
7.1.240.0030.00715.83
7.1.230.0030.01415.55
7.1.220.0040.01115.77
7.1.210.0030.00715.61
7.1.200.0060.01115.98
7.1.190.0080.00415.77
7.1.180.0060.00615.76
7.1.170.0060.00915.70
7.1.160.0100.00315.58
7.1.150.0110.00615.96
7.1.140.0000.01915.52
7.1.130.0060.00915.89
7.1.120.0080.00315.87
7.1.110.0060.00915.65
7.1.100.0030.01215.83
7.1.90.0070.01015.91
7.1.80.0030.01215.78
7.1.70.0040.00716.46
7.1.60.0080.01317.63
7.1.50.0050.01616.26
7.1.40.0000.01415.73
7.1.30.0140.00315.98
7.1.20.0090.00615.75
7.1.10.0040.00715.53
7.1.00.0070.04919.10
7.0.330.0040.01115.38
7.0.320.0100.00615.07
7.0.310.0080.00415.44
7.0.300.0030.01015.55
7.0.290.0000.01115.40
7.0.280.0030.01215.36
7.0.270.0070.00415.19
7.0.260.0110.00415.29
7.0.250.0030.01015.50
7.0.240.0060.01315.57
7.0.230.0030.01315.52
7.0.220.0040.01415.41
7.0.210.0000.01515.46
7.0.200.0490.00715.10
7.0.190.0070.00715.30
7.0.180.0100.00315.54
7.0.170.0030.01315.54
7.0.160.0120.00315.46
7.0.150.0060.00915.28
7.0.140.0030.04318.74
7.0.130.0100.00715.53
7.0.120.0090.00415.61
7.0.110.0040.01115.35
7.0.100.0060.04417.58
7.0.90.0100.04517.80
7.0.80.0250.03917.69
7.0.70.0190.02917.82
7.0.60.0210.04617.63
7.0.50.0280.04217.88
7.0.40.0070.04016.77
7.0.30.0050.03416.80
7.0.20.0100.04416.86
7.0.10.0140.04216.80
7.0.00.0070.04316.76
5.6.400.0060.00314.30
5.6.390.0060.01014.52
5.6.380.0060.01214.67
5.6.370.0140.00314.14
5.6.360.0040.01214.14
5.6.350.0070.00714.31
5.6.340.0050.00514.20
5.6.330.0030.01014.21
5.6.320.0070.00714.25
5.6.310.0030.01214.32
5.6.300.0000.01514.75
5.6.290.0040.01114.39
5.6.280.0100.03817.71
5.6.270.0060.01014.22
5.6.260.0030.01014.45
5.6.250.0020.05017.51
5.6.240.0080.03017.49
5.6.230.0070.04717.37
5.6.220.0050.05117.42
5.6.210.0070.04617.45
5.6.200.0120.03817.74
5.6.190.0040.02617.68
5.6.180.0080.03317.85
5.6.170.0060.04617.66
5.6.160.0020.05117.81
5.6.150.0080.04217.62
5.6.140.0090.04417.61
5.6.130.0090.04417.81
5.6.120.0090.04217.75
5.6.110.0060.03317.62
5.6.100.0030.04717.69
5.6.90.0050.04617.59
5.6.80.0070.04417.26
5.6.70.0030.04517.32
5.6.60.0120.04217.34
5.6.50.0100.03917.33
5.6.40.0100.04617.24
5.6.30.0130.04617.31
5.6.20.0150.03717.46
5.6.10.0080.03517.26
5.6.00.0050.04817.36
5.5.380.0030.05317.37
5.5.370.0060.04517.35
5.5.360.0060.04517.33
5.5.350.0070.04717.26
5.5.340.0080.03017.59
5.5.330.0050.03617.35
5.5.320.0090.04217.49
5.5.310.0100.04317.50
5.5.300.0050.04517.65
5.5.290.0060.04817.49
5.5.280.0090.04017.39
5.5.270.0110.03117.49
5.5.260.0070.05017.51
5.5.250.0160.03717.46
5.5.240.0070.04217.14
5.5.230.0050.05117.06
5.5.220.0110.04317.20
5.5.210.0120.04217.11
5.5.200.0070.04217.14
5.5.190.0110.03317.17
5.5.180.0060.05017.19
5.5.170.0090.00614.31
5.5.160.0080.03816.99
5.5.150.0070.04717.20
5.5.140.0080.04317.15
5.5.130.0020.03917.27
5.5.120.0090.03617.17
5.5.110.0100.04217.07
5.5.100.0120.03917.17
5.5.90.0100.03816.90
5.5.80.0120.03917.10
5.5.70.0090.04617.13
5.5.60.0110.03717.22
5.5.50.0030.04217.23
5.5.40.0090.04416.95
5.5.30.0100.03217.08
5.5.20.0050.04717.21
5.5.10.0100.03717.06
5.5.00.0030.04117.08
5.4.450.0050.04815.86
5.4.440.0060.04415.95
5.4.430.0090.04115.94
5.4.420.0070.04515.84
5.4.410.0090.03515.88
5.4.400.0020.04415.83
5.4.390.0070.04215.62
5.4.380.0080.03015.82
5.4.370.0070.04515.60
5.4.360.0090.03515.78
5.4.350.0020.04915.77
5.4.340.0030.03415.74
5.4.330.0100.00712.42
5.4.320.0080.03115.70
5.4.310.0070.04215.60
5.4.300.0050.04215.72
5.4.290.0070.02515.75
5.4.280.0050.04515.74
5.4.270.0080.03815.78
5.4.260.0070.03915.70
5.4.250.0050.04415.60
5.4.240.0070.03415.65
5.4.230.0100.03715.74
5.4.220.0070.04315.61
5.4.210.0100.03515.82
5.4.200.0080.03815.82
5.4.190.0080.04015.74
5.4.180.0030.04315.76
5.4.170.0070.04315.72
5.4.160.0100.04015.65
5.4.150.0050.03815.68
5.4.140.0060.02514.34
5.4.130.0070.03814.34
5.4.120.0060.05414.37
5.4.110.0030.04314.33
5.4.100.0050.04414.39
5.4.90.0020.04614.35
5.4.80.0070.03514.37
5.4.70.0040.04014.33
5.4.60.0030.04314.33
5.4.50.0080.04114.30
5.4.40.0050.03914.42
5.4.30.0040.03714.33
5.4.20.0070.03814.32
5.4.10.0050.04014.40
5.4.00.0020.04714.08
5.3.290.0100.07714.54
5.3.280.0170.07014.46
5.3.270.0070.08014.59
5.3.260.0030.07714.60
5.3.250.0100.07314.48
5.3.240.0000.06314.46
5.3.230.0030.05314.56
5.3.220.0130.07014.58
5.3.210.0000.05714.58
5.3.200.0070.07714.57
5.3.190.0070.07314.52
5.3.180.0030.08014.55
5.3.170.0030.07714.40
5.3.160.0030.07714.57
5.3.150.0230.06014.54
5.3.140.0070.07314.42
5.3.130.0070.07714.41
5.3.120.0000.08014.47
5.3.110.0070.07314.55
5.3.100.0070.07714.05
5.3.90.0030.07313.89
5.3.80.0100.07313.99
5.3.70.0070.07314.02
5.3.60.0070.06013.87
5.3.50.0070.06713.71
5.3.40.0170.07013.93
5.3.30.0000.07013.86
5.3.20.0100.07013.49
5.3.10.0070.05013.65
5.3.00.0070.03713.41
5.2.170.0030.03710.95
5.2.160.0030.04711.17
5.2.150.0030.06311.16
5.2.140.0100.04711.00
5.2.130.0070.06311.18
5.2.120.0000.04011.07
5.2.110.0030.03011.16
5.2.100.0070.02710.98
5.2.90.0030.06710.91
5.2.80.0070.03711.11
5.2.70.0070.05311.16
5.2.60.0000.03311.05
5.2.50.0070.02710.88
5.2.40.0030.03011.00
5.2.30.0030.03311.04
5.2.20.0000.03010.83
5.2.10.0030.03010.96
5.2.00.0000.03010.78
5.1.60.0030.04310.01
5.1.50.0070.04710.06
5.1.40.0000.02710.06
5.1.30.0030.03010.35
5.1.20.0100.02010.46
5.1.10.0000.0309.91
5.1.00.0000.03010.14
5.0.50.0070.0178.65
5.0.40.0000.0478.50
5.0.30.0030.0308.12
5.0.20.0000.0208.20
5.0.10.0030.0208.19
5.0.00.0000.0378.24
4.4.90.0000.0207.71
4.4.80.0030.0177.71
4.4.70.0000.0207.71
4.4.60.0000.0207.71
4.4.50.0030.0137.71
4.4.40.0000.0277.71
4.4.30.0000.0377.71
4.4.20.0000.0177.71
4.4.10.0000.0177.71
4.4.00.0000.0237.71
4.3.110.0000.0177.71
4.3.100.0030.0137.71
4.3.90.0000.0207.71
4.3.80.0000.0277.71
4.3.70.0000.0177.71
4.3.60.0030.0137.71
4.3.50.0000.0177.71
4.3.40.0030.0237.71
4.3.30.0000.0177.71
4.3.20.0000.0177.71
4.3.10.0000.0177.71
4.3.00.0000.0177.71

preferences:
34.47 ms | 401 KiB | 5 Q