3v4l.org

run code in 300+ PHP versions simultaneously
<?php class It implements Iterator { private $arr = [1,2,3]; public function key() { echo __METHOD__ . "\n"; return key($this->arr); } public function current() { echo __METHOD__ . "\n"; return current($this->arr); } public function rewind() { echo __METHOD__ . "\n"; reset($this->arr); } public function next() { echo __METHOD__ . "\n"; next($this->arr); } public function valid() { echo __METHOD__ . "\n"; return key($this->arr) !== null; } } $it = new It; foreach ($it as $k => $v) {}

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.0070.01318.43
8.3.50.0120.00721.86
8.3.40.0100.00718.85
8.3.30.0140.00719.10
8.3.20.0050.00220.10
8.3.10.0040.00422.08
8.3.00.0000.00822.46
8.2.180.0090.01218.06
8.2.170.0130.00622.96
8.2.160.0130.00722.15
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0030.00526.16
8.2.120.0080.00017.75
8.2.110.0100.01022.13
8.2.100.0040.00819.63
8.2.90.0000.00719.05
8.2.80.0040.00419.77
8.2.70.0000.00917.50
8.2.60.0060.00418.05
8.2.50.0040.00418.07
8.2.40.0050.00318.03
8.2.30.0030.00618.00
8.2.20.0040.00417.73
8.2.10.0040.00419.45
8.2.00.0040.00417.68
8.1.280.0040.01425.92
8.1.270.0060.01322.14
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0090.00024.02
8.1.230.0040.00719.09
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0100.00017.36
8.1.190.0030.00617.51
8.1.180.0040.00418.10
8.1.170.0000.01018.59
8.1.160.0070.00321.93
8.1.150.0040.00418.71
8.1.140.0000.00717.42
8.1.130.0040.00417.75
8.1.120.0000.00717.50
8.1.110.0000.00817.34
8.1.100.0030.00517.37
8.1.90.0030.00517.35
8.1.80.0040.00417.49
8.1.70.0070.00017.39
8.1.60.0080.00317.45
8.1.50.0020.00517.57
8.1.40.0040.00417.40
8.1.30.0040.00417.70
8.1.20.0040.00417.53
8.1.10.0040.00417.56
8.1.00.0070.00017.43
8.0.300.0040.00418.77
8.0.290.0000.00917.18
8.0.280.0000.00718.51
8.0.270.0000.00717.27
8.0.260.0000.00616.84
8.0.250.0060.00016.84
8.0.240.0080.00016.95
8.0.230.0070.00016.97
8.0.220.0070.00016.88
8.0.210.0040.00416.92
8.0.200.0000.00616.88
8.0.190.0080.00016.92
8.0.180.0000.00716.82
8.0.170.0000.00716.89
8.0.160.0070.00016.91
8.0.150.0040.00416.88
8.0.140.0070.00016.86
8.0.130.0030.00313.32
8.0.120.0040.00416.77
8.0.110.0040.00416.94
8.0.100.0040.00416.77
8.0.90.0040.00416.86
8.0.80.0100.01316.96
8.0.70.0070.00016.86
8.0.60.0040.00416.79
8.0.50.0000.00816.91
8.0.30.0100.01017.29
8.0.20.0140.00617.40
8.0.10.0000.00716.96
8.0.00.0120.01016.79
7.4.330.0030.00315.00
7.4.320.0000.00716.61
7.4.300.0000.00716.61
7.4.290.0000.00716.61
7.4.280.0030.00316.43
7.4.270.0030.00316.45
7.4.260.0030.00316.64
7.4.250.0080.00016.46
7.4.240.0010.00716.56
7.4.230.0000.00716.59
7.4.220.0140.00416.57
7.4.210.0110.00316.48
7.4.200.0080.00016.37
7.4.190.0070.00016.57
7.4.160.0120.00416.50
7.4.150.0120.00617.40
7.4.140.0110.00817.86
7.4.130.0070.01116.43
7.4.120.0100.00816.61
7.4.110.0160.00016.63
7.4.100.0060.01216.34
7.4.90.0120.00616.44
7.4.80.0060.01219.39
7.4.70.0160.00016.59
7.4.60.0090.01316.58
7.4.50.0000.00816.63
7.4.40.0040.01222.77
7.4.30.0120.00916.30
7.4.00.0100.00315.16
7.3.330.0030.00313.30
7.3.320.0000.00513.12
7.3.310.0070.00016.36
7.3.300.0030.00316.23
7.3.290.0100.00916.21
7.3.280.0080.00816.31
7.3.270.0080.00817.40
7.3.260.0150.00316.51
7.3.250.0130.00516.55
7.3.240.0130.00316.60
7.3.230.0130.00316.64
7.3.210.0080.00916.51
7.3.200.0100.00719.39
7.3.190.0130.00416.24
7.3.180.0090.00616.34
7.3.170.0130.01016.27
7.3.160.0100.00616.39
7.3.120.0030.01314.84
7.2.330.0070.01116.55
7.2.320.0090.00916.79
7.2.310.0110.00716.77
7.2.300.0090.01116.36
7.2.290.0090.00916.67
7.2.00.0080.00519.27
7.1.200.0150.00315.86
7.1.100.0030.01017.98
7.1.70.0000.01017.04
7.1.60.0160.01019.82
7.1.50.0110.00716.95
7.1.00.0000.08022.44
7.0.200.0040.00716.63
7.0.140.0100.06722.01
7.0.60.0100.03719.95
7.0.50.0030.05717.89
7.0.40.0030.07320.07
7.0.30.0300.04720.33
7.0.20.0300.08020.20
7.0.10.0270.07720.23
7.0.00.0030.08720.20
5.6.280.0070.07021.13
5.6.210.0100.03320.70
5.6.200.0070.05018.16
5.6.190.0030.04320.46
5.6.180.4170.04320.42
5.6.170.0300.07320.56
5.6.160.0030.06320.51
5.6.150.0070.05018.18
5.6.140.0000.04318.14
5.6.130.0070.03718.23
5.6.120.0100.05321.00
5.6.110.0170.07321.03
5.6.100.0100.07320.98
5.6.90.0100.03720.95
5.6.80.0070.07020.49
5.6.70.0400.06320.37
5.5.350.0070.03320.42
5.5.340.0100.07018.07
5.5.330.0170.07020.33
5.5.320.0300.07320.34
5.5.310.0330.08320.29
5.5.300.0070.03717.96
5.5.290.0070.05717.98
5.5.280.0070.07320.69
5.5.270.0030.05320.84
5.5.260.0170.06020.88
5.5.250.0070.07720.67
5.5.240.0070.08320.27
5.4.450.0630.06319.54
5.4.440.0800.05019.47
5.4.430.0100.05719.46
5.4.420.0100.05719.53
5.4.410.0170.05019.21
5.4.400.0130.05718.52
5.4.390.0170.04318.84
5.4.380.0300.05718.70
5.4.370.0200.04718.60
5.4.360.0170.05018.54
5.4.350.0070.06018.77
5.4.340.0100.05318.50
5.4.320.0060.03812.51
5.4.310.0060.03912.50
5.4.300.0040.03912.51
5.4.290.0060.04112.50
5.4.280.0100.04312.40
5.4.270.0130.07018.98
5.4.260.0230.06318.79
5.4.250.0170.07018.85
5.4.240.0500.06019.19
5.4.230.0170.04718.96
5.4.220.0170.07718.96
5.4.210.0130.07018.88
5.4.200.0100.08018.87
5.4.190.0070.08018.91
5.4.180.0170.06318.81
5.4.170.0130.07318.98
5.4.160.0130.05718.97
5.4.150.0100.06018.77
5.4.140.0170.06316.48
5.4.130.0200.05316.59
5.4.120.0170.07016.59
5.4.110.0170.05716.61
5.4.100.0030.05316.62
5.4.90.0070.05016.61
5.4.80.0200.05316.34
5.4.70.0130.05716.57
5.4.60.0030.07716.56
5.4.50.0070.07316.61
5.4.40.0230.04716.68
5.4.30.0130.06316.62
5.4.20.0100.05016.60
5.4.10.0100.06716.39
5.4.00.0100.06716.14
5.3.290.0050.04712.80
5.3.280.0130.05314.64
5.3.270.0070.08014.79
5.3.260.0170.08014.66
5.3.250.0170.06314.91
5.3.240.0130.05314.77
5.3.230.0100.06014.86
5.3.220.0130.05014.61
5.3.210.0170.07014.74
5.3.200.0130.06014.61
5.3.190.0100.04714.76
5.3.180.0200.04714.74
5.3.170.0130.07714.84
5.3.160.0230.05714.82
5.3.150.0030.06314.68
5.3.140.0200.06014.81
5.3.130.0100.07314.59
5.3.120.0070.06714.43
5.3.110.0100.06014.82
5.3.100.0070.07314.21
5.3.90.0100.06014.28
5.3.80.0100.06014.20
5.3.70.0200.04714.31
5.3.60.0130.05014.20
5.3.50.0100.07014.13
5.3.40.0130.06314.13
5.3.30.0070.04713.95
5.3.20.0100.05313.57
5.3.10.0130.06013.86
5.3.00.0030.07013.63
5.2.170.0100.03711.04
5.2.160.0130.03711.30
5.2.150.0070.06311.34
5.2.140.0130.05011.30
5.2.130.0100.04011.31
5.2.120.0100.04011.30
5.2.110.0100.04011.37
5.2.100.0100.05710.95
5.2.90.0100.04311.38
5.2.80.0130.04711.29
5.2.70.0130.04010.96
5.2.60.0030.06011.10
5.2.50.0130.04011.30
5.2.40.0030.04311.11
5.2.30.0070.05011.15
5.2.20.0070.05310.97
5.2.10.0100.03310.88
5.2.00.0070.05310.77
5.1.60.0070.04710.20
5.1.50.0070.03010.30
5.1.40.0030.05010.26
5.1.30.0030.03710.45
5.1.20.0100.03310.64
5.1.10.0070.04310.07
5.1.00.0000.05310.22
5.0.50.0230.0208.93
5.0.40.0100.0208.93
5.0.30.0030.0438.93
5.0.20.0070.0238.93
5.0.10.0130.0308.93
5.0.00.0000.0478.93
4.4.90.0070.0208.93
4.4.80.0100.0178.93
4.4.70.0030.0308.93
4.4.60.0000.0238.93
4.4.50.0030.0338.93
4.4.40.0070.0408.93
4.4.30.0000.0308.93
4.4.20.0100.0178.93
4.4.10.0070.0308.93
4.4.00.0030.0408.93
4.3.110.0030.0208.93
4.3.100.0030.0308.93
4.3.90.0030.0308.93
4.3.80.0030.0308.93
4.3.70.0000.0238.93
4.3.60.0030.0208.93
4.3.50.0030.0308.93
4.3.40.0000.0408.93
4.3.30.0000.0238.93
4.3.20.0070.0178.93
4.3.10.0030.0238.93
4.3.00.0070.0238.23

preferences:
58.27 ms | 401 KiB | 5 Q