3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2,3,4,5,6,7,8,9,10); $key = 2; $a = array(1,2,'foo'=>3,4,5,6,7,8,9,10); $key = '2'; 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.0131.99016.63
8.3.50.0271.97516.28
8.3.40.0071.99518.59
8.3.30.0101.99218.70
8.3.20.0031.99718.83
8.3.10.0032.00020.40
8.3.00.0032.00017.50
8.2.180.0032.00016.50
8.2.170.0032.00022.96
8.2.160.0031.99822.19
8.2.150.0032.00024.18
8.2.140.0002.00324.66
8.2.130.0002.00326.16
8.2.120.0002.00219.89
8.2.110.0071.99521.03
8.2.100.0032.00517.91
8.2.90.0071.99519.52
8.2.80.0201.98219.39
8.2.70.0031.99417.63
8.2.60.0032.00018.05
8.2.50.0071.99918.07
8.2.40.0031.99720.07
8.2.30.0101.99218.21
8.2.20.0002.00217.80
8.2.10.0031.99817.71
8.2.00.0002.00617.79
8.1.280.0131.98825.92
8.1.270.0031.99923.99
8.1.260.0101.99126.35
8.1.250.0031.99828.09
8.1.240.0002.00322.59
8.1.230.0071.99521.04
8.1.220.0002.00217.74
8.1.210.0031.99818.89
8.1.200.0071.99817.48
8.1.190.0002.00317.51
8.1.180.0002.00418.10
8.1.170.0002.00218.59
8.1.160.0031.99818.97
8.1.150.0031.99918.72
8.1.140.0032.00117.41
8.1.130.0002.00117.94
8.1.120.0032.00117.51
8.1.110.0031.99817.55
8.1.100.0032.00017.43
8.1.90.0002.00317.49
8.1.80.0031.99917.44
8.1.70.0032.00017.44
8.1.60.0031.99817.60
8.1.50.0031.99817.55
8.1.40.0131.98617.58
8.1.30.0071.99517.65
8.1.20.0031.99917.63
8.1.10.0071.99717.59
8.1.00.0031.99817.48
8.0.300.0071.99619.95
8.0.290.0002.00316.63
8.0.280.0032.00118.40
8.0.270.0101.98817.18
8.0.260.0031.99818.55
8.0.250.0031.99616.95
8.0.240.0131.97916.95
8.0.230.0031.99816.81
8.0.220.0031.99916.76
8.0.210.0031.99816.81
8.0.200.0031.99916.98
8.0.190.0002.00316.94
8.0.180.0002.00416.78
8.0.170.0071.99616.75
8.0.160.0032.00016.92
8.0.150.0032.00016.82
8.0.140.0431.95816.72
8.0.130.0071.99513.38
8.0.120.0032.00016.87
8.0.110.0071.99416.85
8.0.100.0002.00216.82
8.0.90.0071.99516.63
8.0.80.0061.99516.77
8.0.70.0032.00116.65
8.0.60.0031.99816.85
8.0.50.0032.00116.79
8.0.30.0052.00616.92
8.0.20.0211.98017.18
8.0.10.0031.99816.93
8.0.00.0321.94816.64
7.4.330.0032.00014.65
7.4.320.0031.99916.38
7.4.300.0002.00216.36
7.4.290.0002.00316.42
7.4.280.0032.00016.45
7.4.270.0031.99816.48
7.4.260.0002.00313.25
7.4.250.0002.00216.49
7.4.240.0071.99716.42
7.4.230.0031.99816.14
7.4.220.0661.95516.25
7.4.210.0071.99516.50
7.4.200.0031.99916.49
7.4.190.0002.00216.45
7.4.160.0032.00316.32
7.4.150.0101.98417.18
7.4.140.0211.97917.13
7.4.130.0131.98816.55
7.4.120.0082.00116.49
7.4.110.0292.29916.40
7.4.100.0132.45516.39
7.4.90.0192.44316.48
7.4.80.0072.46318.80
7.4.70.0132.45616.46
7.4.60.0032.46116.46
7.4.50.0002.49916.42
7.4.40.0032.49322.27
7.4.30.0202.44816.51
7.4.00.0072.49114.80
7.3.330.0161.95613.24
7.3.320.0002.00113.20
7.3.310.0071.99616.07
7.3.300.0101.99216.26
7.3.290.0131.98816.16
7.3.280.0091.99016.25
7.3.270.0161.97517.18
7.3.260.0101.99018.24
7.3.250.0231.97016.30
7.3.240.0131.98716.20
7.3.230.0232.39916.44
7.3.210.0132.46216.48
7.3.200.0202.44819.39
7.3.190.0292.37816.68
7.3.180.0032.47516.32
7.3.170.0132.44616.58
7.3.160.0192.46216.55
7.3.120.0172.47714.77
7.2.330.0132.45316.43
7.2.320.0102.40816.63
7.2.310.0162.43216.49
7.2.300.0202.43316.44
7.2.290.0202.42216.65
7.2.60.0032.49216.71
7.2.00.0072.49419.23
7.1.200.0002.49815.91
7.1.100.0072.49518.03
7.1.70.0032.49817.15
7.1.60.0132.48819.40
7.1.50.0032.49816.84
7.1.00.0002.50022.39
7.0.200.0032.49816.82
7.0.140.0072.49321.95
7.0.80.0272.47319.83
7.0.70.0072.49320.01
7.0.60.0532.44720.02
7.0.50.0472.45320.35
7.0.40.0032.49720.05
7.0.30.0132.48720.11
7.0.20.0002.50020.15
7.0.10.0172.48320.09
7.0.00.0032.45320.03
5.6.280.0032.49720.93
5.6.230.0172.48320.64
5.6.220.0132.48720.68
5.6.210.0132.48720.45
5.6.200.0002.48320.96
5.6.190.0102.49020.93
5.6.180.0132.48721.18
5.6.170.0132.48721.18
5.6.160.0132.45721.11
5.6.150.0032.49721.11
5.6.140.0102.49020.99
5.6.130.0102.47720.97
5.6.120.0032.45721.10
5.6.110.0072.49321.07
5.6.100.0032.49721.07
5.6.90.0172.48321.07
5.6.80.0002.39320.53
5.6.70.0172.46320.45
5.6.60.0132.48720.49
5.6.50.0032.49720.34
5.6.40.0102.49020.41
5.6.30.0032.47320.39
5.6.20.0132.47320.42
5.6.10.0102.49020.36
5.6.00.0072.49320.41
5.5.370.0172.36320.52
5.5.360.0172.37320.63
5.5.350.0072.41720.43
5.5.340.0232.39320.90
5.5.330.0132.40720.86
5.5.320.0432.39320.79
5.5.310.0272.41320.87
5.5.300.0272.42020.94
5.5.290.0202.43020.93
5.5.280.0102.41720.88
5.5.270.0332.42720.98
5.5.260.0232.43720.86
5.5.250.0232.45720.53
5.5.240.0232.41720.20
5.5.230.0172.43020.09
5.5.220.0072.45320.21
5.5.210.0132.41320.27
5.5.200.0172.34720.29
5.5.190.0272.36720.29
5.5.180.0172.42020.29
5.5.160.0202.41320.13
5.5.150.0232.40320.24
5.5.140.0172.40720.29
5.5.130.0202.43020.28
5.5.120.0272.43720.21
5.5.110.0202.39320.30
5.5.100.0432.40720.20
5.5.90.0172.41720.14
5.5.80.0232.44320.22
5.5.70.0072.35320.13
5.5.60.0332.40320.20
5.5.50.0132.44019.96
5.5.40.0102.37320.13
5.5.30.0332.40720.17
5.5.20.0032.41020.06
5.5.10.0202.34720.15
5.5.00.0132.29020.18
5.4.450.0332.39019.42
5.4.440.0332.40719.37
5.4.430.0172.42319.38
5.4.420.0072.45319.35
5.4.410.0372.38319.24
5.4.400.0202.38719.05
5.4.390.0132.45719.04
5.4.380.0172.44019.22
5.4.370.0172.41319.03
5.4.360.0232.41319.09
5.4.350.0232.41318.86
5.4.340.0172.42718.86
5.4.320.0172.37019.06
5.4.310.0372.38719.07
5.4.300.0172.43018.89
5.4.290.0202.41319.04
5.4.280.0102.41718.85
5.4.270.0272.41718.95
5.4.260.0132.44718.85
5.4.250.0372.44319.02
5.4.240.0432.39019.02
5.4.230.0272.38718.85
5.4.220.0332.43019.02
5.4.210.0232.37718.95
5.4.200.0172.44719.04
5.4.190.0202.42719.02
5.4.180.0302.45018.87
5.4.170.0402.41019.04
5.4.160.0202.43018.84
5.4.150.0202.40719.03
5.4.140.0132.43016.28
5.4.130.0102.36316.23
5.4.120.0202.38316.36
5.4.110.0232.41016.55
5.4.100.0232.35316.25
5.4.90.0172.32316.50
5.4.80.0102.45716.51
5.4.70.0172.45016.47
5.4.60.0072.45016.25
5.4.50.0202.42716.41
5.4.40.0202.44016.23
5.4.30.0302.43316.47
5.4.20.0232.43716.52
5.4.10.0202.40316.40
5.4.00.0202.38015.75
5.3.290.0030.03014.68
5.3.280.0030.03014.73
5.3.270.0030.08314.73
5.3.260.0000.04714.66
5.3.250.0030.06314.59
5.3.240.0070.04314.61
5.3.230.0000.03714.74
5.3.220.0100.07014.50
5.3.210.0000.06714.50
5.3.200.0030.05714.52
5.3.190.0030.04314.69
5.3.180.0100.08314.68
5.3.170.0070.07314.59
5.3.160.0100.07714.70
5.3.150.0100.07014.63
5.3.140.0070.09314.65
5.3.130.0000.03314.48
5.3.120.0030.03014.61
5.3.110.0030.05014.57
5.3.100.0100.07314.13
5.3.90.0030.07714.11
5.3.80.0000.07713.92
5.3.70.0030.08314.08
5.3.60.0100.05013.90
5.3.50.0100.07013.93
5.3.40.0100.06713.89
5.3.30.0030.04013.82
5.3.20.0000.06713.75
5.3.10.0100.04013.74
5.3.00.0100.07013.56
5.2.170.0000.06011.64
5.2.160.0100.05711.64
5.2.150.0030.05711.64
5.2.140.0000.06011.64
5.2.130.0000.04011.64
5.2.120.0130.05711.64
5.2.110.0070.02711.64
5.2.100.0030.03311.64
5.2.90.0070.06011.64
5.2.80.0000.03711.64
5.2.70.0070.04311.64
5.2.60.0100.05011.64
5.2.50.0100.05711.64
5.2.40.0000.05311.64
5.2.30.0000.05711.64
5.2.20.0030.04011.64
5.2.10.0070.05711.64
5.2.00.0030.04011.64
5.1.60.0000.03011.64
5.1.50.0030.02711.64
5.1.40.0000.02711.64
5.1.30.0030.04011.64
5.1.20.0030.05711.64
5.1.10.0070.05711.64
5.1.00.0000.05011.64
5.0.50.0070.03711.64
5.0.40.0030.04311.64
5.0.30.0070.06011.64
5.0.20.0000.04711.64
5.0.10.0000.03311.64
5.0.00.0030.05711.64
4.4.90.0000.03311.64
4.4.80.0070.03011.64
4.4.70.0000.01711.64
4.4.60.0000.02011.64
4.4.50.0000.02711.64
4.4.40.0000.05011.64
4.4.30.0030.03011.64
4.4.20.0070.03711.64
4.4.10.0030.03311.64
4.4.00.0030.04311.64
4.3.110.0000.03711.64
4.3.100.0000.03011.64
4.3.90.0070.01711.64
4.3.80.0000.06311.64
4.3.70.0030.03711.64
4.3.60.0030.02311.64
4.3.50.0030.03311.64
4.3.40.0000.04011.64
4.3.30.0000.02711.64
4.3.20.0000.04011.64
4.3.10.0000.02311.64
4.3.00.0000.03711.64

preferences:
57.57 ms | 401 KiB | 5 Q