3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0, 10000); $time = microtime(true); $b = array_filter($a, function($el) { return $el % 2 === 0; }); var_dump(microtime(true) - $time); $b = []; $time = microtime(true); foreach ($a as $el) { if ($el % 2 === 0) { $b[] = $el; } } var_dump(microtime(true) - $time);

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.00.0090.00815.87
7.3.120.0070.01715.79
7.3.110.0130.00915.91
7.3.100.0000.01815.88
7.3.90.0030.01215.36
7.3.80.0070.01015.60
7.3.70.0060.00915.65
7.3.60.0090.00915.67
7.3.50.0040.01115.47
7.3.40.0000.01015.73
7.3.30.0060.01015.78
7.3.20.0070.00716.70
7.3.10.0070.00716.65
7.3.00.0040.01216.78
7.2.250.0130.01016.11
7.2.240.0110.01115.94
7.2.230.0070.01116.07
7.2.220.0000.01315.60
7.2.210.0070.01015.97
7.2.200.0080.00315.57
7.2.190.0030.01315.80
7.2.180.0070.01015.92
7.2.170.0090.00915.86
7.1.330.0030.01015.93
7.1.320.0090.00315.61
7.1.310.0030.01315.88
7.1.300.0060.00615.38
7.1.290.0070.01015.86
7.1.280.0030.01315.74
7.1.270.0000.01315.79
7.1.260.0000.01916.04
7.1.70.0060.01216.95
7.1.60.0040.00817.29
7.1.50.0040.01116.85
7.1.00.0000.04022.46
7.0.200.0030.01416.82
7.0.140.0030.07721.92
7.0.120.0170.06322.15
7.0.60.0070.08720.68
7.0.50.0000.09318.65
7.0.40.0030.05319.96
7.0.30.0170.04720.13
7.0.20.0170.06020.06
7.0.10.0100.08020.09
7.0.00.0100.08320.29
5.6.280.0030.08022.71
5.6.210.0270.07322.53
5.6.200.0070.04720.03
5.6.190.0000.05022.23
5.6.180.0470.05322.16
5.6.170.0230.04322.25
5.6.160.0070.04322.23
5.6.150.0030.08719.95
5.6.140.0070.08719.92
5.6.130.0070.07719.93
5.6.120.0070.07022.92
5.6.110.0100.04322.78
5.6.100.0170.08022.89
5.6.90.0100.07322.75
5.6.80.0130.08322.18
5.5.350.0170.06722.15
5.5.340.0030.09019.77
5.5.330.0070.07021.99
5.5.320.0270.04321.92
5.5.310.0230.08322.02
5.5.300.0170.08019.80
5.5.290.0130.06319.74
5.5.280.0070.06722.57
5.5.270.0070.06722.65
5.5.260.0230.07022.64
5.5.250.0130.03722.46
5.5.240.0000.08322.04
5.4.450.0030.04720.93
5.4.440.0100.03720.92
5.4.430.0100.03721.29
5.4.420.0000.04321.27
5.4.410.0030.04021.07
5.4.400.0200.07020.83
5.4.390.0030.07020.60
5.4.380.0130.07720.59
5.4.370.0100.07720.88
5.4.360.0100.08320.78
5.4.350.0030.06320.85
5.4.340.0070.08720.71
5.4.320.0100.08020.71
5.4.310.0100.06720.60
5.4.300.0030.08320.75
5.4.290.0130.07020.96
5.4.280.0030.09020.75
5.4.270.0070.08020.59
5.4.260.0030.06020.58
5.4.250.0030.07020.75
5.4.240.0200.06720.64
5.4.230.0000.06020.86
5.4.220.0130.07720.88
5.4.210.0070.04320.95
5.4.200.0030.04720.82
5.4.190.0070.05320.61
5.4.180.0070.06720.87
5.4.170.0200.07320.75
5.4.160.0100.07320.58
5.4.150.0030.05720.57
5.4.140.0070.06718.07
5.4.130.0070.07718.23
5.4.120.0030.08318.14
5.4.110.0100.09318.21
5.4.100.0100.08018.04
5.4.90.0070.07718.07
5.4.80.0100.08318.20
5.4.70.0030.07318.16
5.4.60.0100.05718.24
5.4.50.0000.07018.20
5.4.40.0070.05717.99
5.4.30.0070.04318.00
5.4.20.0070.05718.30
5.4.10.0070.04017.99
5.4.00.0070.04317.61
5.3.290.0100.07314.69
5.3.280.0030.06314.62
5.3.270.0130.03714.76
5.3.260.0030.05714.63
5.3.250.0070.07014.52
5.3.240.0070.05314.65
5.3.230.0130.04714.64
5.3.220.0130.06014.72
5.3.210.0170.07014.63
5.3.200.0100.07314.64
5.3.190.0030.04014.71
5.3.180.0030.06014.62
5.3.170.0070.05714.57
5.3.160.0100.07014.55
5.3.150.0100.07014.45
5.3.140.0070.07714.55
5.3.130.0030.08314.60
5.3.120.0100.04314.56
5.3.110.0030.07314.57
5.3.100.0070.07313.95
5.3.90.0070.03714.05
5.3.80.0030.05714.03
5.3.70.0070.04013.98
5.3.60.0100.04014.07
5.3.50.0030.06313.84
5.3.40.0070.03314.00
5.3.30.0130.06713.98
5.3.20.0030.07313.70
5.3.10.0130.06013.81
5.3.00.0070.06313.67
5.2.170.0100.05711.00
5.2.160.0070.03011.30
5.2.150.0070.05711.15
5.2.140.0030.04011.13
5.2.130.0030.04711.09
5.2.120.0030.05711.04
5.2.110.0070.06011.18
5.2.100.0030.05710.96
5.2.90.0070.05011.11
5.2.80.0030.06711.09
5.2.70.0070.06011.25
5.2.60.0030.04011.02
5.2.50.0070.05310.92
5.2.40.0070.04011.14
5.2.30.0100.04710.79
5.2.20.0100.06010.88
5.2.10.0100.05010.86
5.2.00.0100.05310.77
5.1.60.0100.0479.89
5.1.50.0000.0509.89
5.1.40.0000.0439.97
5.1.30.0070.05010.38
5.1.20.0070.03310.38
5.1.10.0130.04710.05
5.1.00.0070.03310.08
5.0.50.0000.0308.70
5.0.40.0000.0378.39
5.0.30.0000.0338.28
5.0.20.0030.0278.20
5.0.10.0000.0208.16
5.0.00.0030.0308.20
4.4.90.0000.0208.05
4.4.80.0030.0338.05
4.4.70.0030.0338.05
4.4.60.0030.0238.05
4.4.50.0000.0238.05
4.4.40.0000.0338.05
4.4.30.0000.0208.05
4.4.20.0000.0308.05
4.4.10.0030.0238.05
4.4.00.0030.0438.05
4.3.110.0030.0178.05
4.3.100.0000.0208.05
4.3.90.0030.0138.05
4.3.80.0000.0508.05
4.3.70.0000.0238.05
4.3.60.0000.0208.05
4.3.50.0030.0308.05
4.3.40.0000.0538.05
4.3.30.0000.0308.05
4.3.20.0000.0238.05
4.3.10.0070.0338.05
4.3.00.0000.0338.05

preferences:
41.55 ms | 401 KiB | 5 Q