3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2,'foo'=>3,4,5,6,7,8,9,10); $key = '1'; foreach (new LimitIterator(new CallbackFilterIterator(new InfiniteIterator(new ArrayIterator($a)), function($v, $k) use ($key) { static $good = false; $good |= $k === $key; return $good; }), 0, count($a)) as $k => $v) { echo "$k => $v\n"; }

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)
8.3.60.0071.99416.25
8.3.50.0201.97516.51
8.3.40.0031.99818.76
8.3.30.0072.00118.47
8.3.20.0071.99418.60
8.3.10.0071.99018.73
8.3.00.0071.99319.25
8.2.180.0071.99516.38
8.2.170.0032.00022.96
8.2.160.0002.00220.35
8.2.150.0071.99524.18
8.2.140.0071.99524.66
8.2.130.0031.99926.16
8.2.120.0032.00120.58
8.2.110.0071.99720.89
8.2.100.0031.99817.91
8.2.90.0211.96319.34
8.2.80.0031.99919.28
8.2.70.0002.00517.75
8.2.60.0031.99918.03
8.2.50.0031.99718.07
8.2.40.0032.00018.16
8.2.30.0031.99818.25
8.2.20.0071.99617.71
8.2.10.0002.00317.81
8.2.00.0101.99117.71
8.1.280.0071.99525.92
8.1.270.0071.99624.66
8.1.260.0031.99926.35
8.1.250.0031.99928.09
8.1.240.0101.99323.84
8.1.230.0101.99320.87
8.1.220.0031.99817.74
8.1.210.0002.00518.91
8.1.200.0032.00217.36
8.1.190.0002.00317.51
8.1.180.0071.99518.10
8.1.170.0032.00018.75
8.1.160.0002.00319.02
8.1.150.0071.99318.77
8.1.140.0031.99817.40
8.1.130.0002.00417.85
8.1.120.0071.99917.45
8.1.110.0002.00317.52
8.1.100.0002.00317.53
8.1.90.0031.99817.44
8.1.80.0002.00317.36
8.1.70.0002.00417.42
8.1.60.0002.00317.54
8.1.50.0032.00017.58
8.1.40.0032.00117.47
8.1.30.0031.99817.64
8.1.20.0131.98917.66
8.1.10.0031.99817.53
8.1.00.0031.99817.63
8.0.300.0002.00119.73
8.0.290.0032.00016.58
8.0.280.0031.99818.44
8.0.270.0071.99617.16
8.0.260.0002.00316.73
8.0.250.0071.99616.87
8.0.240.0002.00316.81
8.0.230.0032.00116.90
8.0.220.0032.00016.66
8.0.210.0031.99716.68
8.0.200.0002.00216.90
8.0.190.0002.00216.88
8.0.180.0071.99516.76
8.0.170.0002.00316.83
8.0.160.0031.99916.86
8.0.150.0031.99816.68
8.0.140.0501.94216.76
8.0.130.0002.00213.29
8.0.120.0002.00216.80
8.0.110.0031.99816.68
8.0.100.0032.00016.81
8.0.90.0002.00416.81
8.0.80.0131.99016.75
8.0.70.0031.99916.64
8.0.60.0031.99916.75
8.0.50.0071.99416.74
8.0.30.0131.98716.95
8.0.20.0161.99116.78
8.0.10.0032.00016.80
8.0.00.0161.97716.77
7.4.330.0032.00012.99
7.4.320.0031.99816.34
7.4.300.0002.00216.31
7.4.290.0071.99416.46
7.4.280.0002.00216.48
7.4.270.0032.00016.41
7.4.260.0002.00113.27
7.4.250.0002.00316.46
7.4.240.0121.99016.46
7.4.230.0071.99416.23
7.4.220.0161.98416.26
7.4.210.0101.99216.43
7.4.200.0201.98416.52
7.4.190.0031.99616.43
7.4.160.0071.99216.50
7.4.150.0191.98116.22
7.4.140.0131.98916.38
7.4.130.0101.99316.52
7.4.120.0131.98916.42
7.4.110.0072.42216.27
7.4.100.0072.46616.42
7.4.90.0132.42316.41
7.4.80.0102.45219.39
7.4.70.0162.42516.49
7.4.60.0132.45016.54
7.4.50.0072.48916.23
7.4.40.0032.49416.14
7.4.30.0032.47016.52
7.4.00.0072.48315.06
7.3.330.0031.99813.10
7.3.320.0002.00313.22
7.3.310.0071.99716.33
7.3.300.0031.99716.28
7.3.290.0231.94916.22
7.3.280.0091.99116.28
7.3.270.0201.97716.35
7.3.260.0131.99616.09
7.3.250.0281.94816.25
7.3.240.0031.99416.22
7.3.230.0102.41016.48
7.3.210.0032.47216.41
7.3.200.0062.43816.59
7.3.190.0162.45016.52
7.3.180.0192.40116.09
7.3.170.0032.46916.18
7.3.160.0002.47716.18
7.3.120.0072.49114.80
7.2.330.0172.44116.74
7.2.320.0102.41016.56
7.2.310.0162.44016.40
7.2.300.0072.44116.29
7.2.290.0102.47116.69
7.2.00.0032.49819.25
7.1.70.0032.49817.00
7.1.60.0632.43817.32
7.1.50.0302.45116.93
7.1.00.0032.49722.26
7.0.200.0072.49516.56
7.0.140.0072.49321.95
7.0.120.0072.49321.96
7.0.100.2202.28019.94
7.0.90.0102.49019.93
7.0.80.0032.49719.88
7.0.70.0132.48719.88
7.0.60.0132.48719.87
7.0.50.0102.49020.24
7.0.40.0072.49320.09
7.0.30.0072.49320.03
7.0.20.0072.49320.09
7.0.10.0032.49719.99
7.0.00.0102.49020.12
5.6.250.0002.50020.54
5.6.240.0072.49320.68
5.6.230.0132.48720.54
5.6.220.0102.49020.58
5.6.210.0072.49320.62
5.6.200.0102.49021.04
5.6.190.0102.49021.00
5.6.180.0072.49320.97
5.6.170.0072.49320.99
5.6.160.0102.49020.96
5.6.150.0032.49720.88
5.6.140.0002.50020.95
5.6.130.0002.50021.12
5.6.120.0032.49720.96
5.6.110.0102.48321.07
5.6.100.0102.49020.96
5.6.90.0032.49721.04
5.6.80.0072.49320.41
5.6.70.0202.48020.36
5.6.60.0032.49720.36
5.6.50.0032.49720.39
5.6.40.0202.48020.30
5.6.30.0072.49320.32
5.6.20.0102.49020.41
5.6.10.0032.49720.25
5.6.00.0102.49020.36
5.5.380.0072.49320.35
5.5.370.0172.05020.42
5.5.360.0101.92720.54
5.5.350.0071.91320.58
5.5.340.0101.89320.95
5.5.330.0231.97320.87
5.5.320.0072.39020.80
5.5.310.0172.43020.88
5.5.300.0202.40320.93
5.5.290.0071.91020.89
5.5.280.0132.01720.94
5.5.270.0171.98020.84
5.5.260.0471.83320.67
5.5.250.0132.38020.65
5.5.240.0172.44320.31
5.5.230.0172.40320.27
5.5.220.0132.42720.34
5.5.210.0102.43720.31
5.5.200.0132.44320.07
5.5.190.0202.41720.32
5.5.180.0072.46320.32
5.5.160.0232.42320.11
5.5.150.0132.46320.14
5.5.140.0202.40320.28
5.5.130.0132.45320.20
5.5.120.0102.47020.19
5.5.110.0172.46020.29
5.5.100.0232.39320.21
5.5.90.0072.44720.21
5.5.80.0172.40320.08
5.5.70.0232.40019.99
5.5.60.0132.43720.21
5.5.50.0102.44720.21
5.5.40.0102.42020.20
5.5.30.0202.43720.00
5.5.20.0172.43720.11
5.5.10.0202.40020.16
5.5.00.0102.45020.17
5.4.450.0202.01319.38
5.4.440.0332.01719.17
5.4.430.0401.95319.37
5.4.420.0132.01319.37
5.4.410.0102.12319.07
5.4.400.0072.45019.23
5.4.390.0072.46019.05
5.4.380.0302.41719.07
5.4.370.0272.41019.02
5.4.360.0072.42718.91
5.4.350.0132.41718.89
5.4.340.0202.44319.05
5.4.320.0132.44719.03
5.4.310.0272.42019.05
5.4.300.0072.45018.90
5.4.290.0272.41719.06
5.4.280.0172.42319.04
5.4.270.0372.40019.05
5.4.260.0232.40718.91
5.4.250.0132.43719.05
5.4.240.0172.43019.19
5.4.230.0002.49318.83
5.4.220.0102.45318.83
5.4.210.0132.42719.04
5.4.200.0072.41318.84
5.4.190.0072.45018.83
5.4.180.0272.42719.01
5.4.170.0172.46719.02
5.4.160.0302.40018.82
5.4.150.0032.44318.89
5.4.140.0202.39016.28
5.4.130.0102.44716.30
5.4.120.0202.44316.39
5.4.110.0132.47016.44
5.4.100.0072.43016.48
5.4.90.0202.44716.44
5.4.80.0172.34316.24
5.4.70.0232.38016.48
5.4.60.0172.43716.45
5.4.50.0102.35716.49
5.4.40.0272.36316.45
5.4.30.0202.43316.48
5.4.20.0232.43016.21
5.4.10.0132.43016.43
5.4.00.0072.43715.84
5.3.290.0070.07014.66
5.3.280.0070.06014.61
5.3.270.0100.07714.67
5.3.260.0130.07014.53
5.3.250.0000.07314.56
5.3.240.0100.03714.67
5.3.230.0070.03314.60
5.3.220.0000.07714.52
5.3.210.0070.05014.63
5.3.200.0030.08014.49
5.3.190.0070.07314.51
5.3.180.0030.08014.61
5.3.170.0130.08014.51
5.3.160.0030.08014.62
5.3.150.0030.09014.52
5.3.140.0130.07014.58
5.3.130.0030.07714.46
5.3.120.0070.06714.61
5.3.110.0130.07014.53
5.3.100.0000.07713.96
5.3.90.0000.07014.04
5.3.80.0030.08013.92
5.3.70.0030.05014.14
5.3.60.0100.03314.07
5.3.50.0070.06013.97
5.3.40.0100.06713.84
5.3.30.0170.04013.82
5.3.20.0070.07013.81
5.3.10.0100.07313.75
5.3.00.0030.07713.73
5.2.170.0030.04711.17
5.2.160.0030.06311.14
5.2.150.0130.06011.02
5.2.140.0070.06711.13
5.2.130.0070.06011.08
5.2.120.0030.05711.12
5.2.110.0030.06311.15
5.2.100.0000.06311.09
5.2.90.0070.05711.10
5.2.80.0100.06011.13
5.2.70.0130.05311.17
5.2.60.0030.04710.93
5.2.50.0070.06711.07
5.2.40.0030.06710.84
5.2.30.0070.06710.83
5.2.20.0030.06011.01
5.2.10.0030.04710.91
5.2.00.0100.05710.62
5.1.60.0000.04710.04
5.1.50.0070.05010.06
5.1.40.0030.0439.96
5.1.30.0000.04010.25
5.1.20.0070.06710.39
5.1.10.0030.0379.95
5.1.00.0030.03710.12
5.0.50.0000.0478.60
5.0.40.0070.0408.41
5.0.30.0030.0508.20
5.0.20.0100.0238.28
5.0.10.0030.0408.00
5.0.00.0000.0508.23
4.4.90.0000.0277.37
4.4.80.0030.0337.37
4.4.70.0000.0377.37
4.4.60.0030.0337.37
4.4.50.0030.0337.37
4.4.40.0030.0537.37
4.4.30.0070.0307.37
4.4.20.0100.0307.37
4.4.10.0000.0407.37
4.4.00.0030.0477.37
4.3.110.0000.0237.37
4.3.100.0000.0177.37
4.3.90.0000.0377.37
4.3.80.0030.0507.37
4.3.70.0000.0377.37
4.3.60.0100.0277.37
4.3.50.0070.0337.37
4.3.40.0070.0507.37
4.3.30.0030.0237.37
4.3.20.0000.0377.37
4.3.10.0000.0377.37
4.3.00.0000.0207.37

preferences:
59.54 ms | 401 KiB | 5 Q