3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myIterator implements Iterator { private $position = 0; private $array = array( "firstelement", "secondelement", "lastelement", ); public function __construct() { $this->position = 0; } function rewind() { $this->position = 0; } function current() { return $this->array[$this->position]; } function key() { return $this->position; } function next() { ++$this->position; } function valid() { return isset($this->array[$this->position]); } } $it = new myIterator; var_dump($it->key()); var_dump(key($it)); ?>

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.0090.00618.68
8.3.50.0140.00721.86
8.3.40.0110.00318.88
8.3.30.0070.01019.09
8.3.20.0070.00020.21
8.3.10.0040.00421.87
8.3.00.0080.00022.57
8.2.180.0100.01018.41
8.2.170.0070.00722.96
8.2.160.0140.00022.08
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00220.75
8.2.110.0080.00419.30
8.2.100.0130.00019.64
8.2.90.0060.00319.25
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0080.00017.93
8.2.50.0040.00418.07
8.2.40.0000.00921.18
8.2.30.0030.00517.95
8.2.20.0000.00817.63
8.2.10.0020.00518.10
8.2.00.0000.00718.09
8.1.280.0090.00625.92
8.1.270.0040.00420.21
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00619.23
8.1.230.0070.00419.06
8.1.220.0030.00617.74
8.1.210.0050.00318.77
8.1.200.0050.00517.35
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0000.00818.55
8.1.160.0030.00522.02
8.1.150.0040.00419.00
8.1.140.0030.00617.41
8.1.130.0070.00017.72
8.1.120.0040.00417.47
8.1.110.0040.00417.43
8.1.100.0080.00017.52
8.1.90.0050.00317.38
8.1.80.0060.00317.46
8.1.70.0070.00017.35
8.1.60.0080.00017.62
8.1.50.0030.00517.52
8.1.40.0050.00317.39
8.1.30.0050.00317.58
8.1.20.0030.00617.48
8.1.10.0050.00317.35
8.1.00.0000.00717.38
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0070.00018.36
8.0.270.0000.00717.23
8.0.260.0030.00317.25
8.0.250.0030.00316.97
8.0.240.0000.00716.85
8.0.230.0080.00016.98
8.0.220.0000.00716.95
8.0.210.0030.00316.94
8.0.200.0030.00317.00
8.0.190.0090.00017.00
8.0.180.0080.00016.90
8.0.170.0000.00716.96
8.0.160.0030.00316.92
8.0.150.0040.00416.84
8.0.140.0040.00416.90
8.0.130.0030.00313.29
8.0.120.0040.00416.84
8.0.110.0070.00016.91
8.0.100.0070.00016.79
8.0.90.0040.00416.84
8.0.80.0000.01616.86
8.0.70.0030.00516.80
8.0.60.0000.00816.92
8.0.50.0030.00716.68
8.0.30.0070.01116.88
8.0.20.0080.01117.40
8.0.10.0050.00216.82
8.0.00.0080.01216.82
7.4.330.0020.00215.08
7.4.320.0030.00316.46
7.4.300.0000.00716.58
7.4.290.0040.00416.61
7.4.280.0000.00816.55
7.4.270.0030.00316.62
7.4.260.0050.00316.52
7.4.250.0030.00316.58
7.4.240.0040.00416.54
7.4.230.0030.00316.54
7.4.220.0060.00916.59
7.4.210.0070.01416.48
7.4.200.0040.00416.60
7.4.160.0120.00416.55
7.4.150.0090.00917.40
7.4.140.0090.01417.86
7.4.130.0100.00816.58
7.4.120.0100.00716.43
7.4.110.0110.00716.65
7.4.100.0070.01116.45
7.4.90.0120.00516.55
7.4.80.0150.00619.39
7.4.70.0130.01316.58
7.4.60.0070.01016.50
7.4.50.0030.00316.59
7.4.40.0090.01316.74
7.4.30.0130.01016.38
7.4.00.0060.01014.95
7.3.330.0000.00513.17
7.3.320.0050.00013.17
7.3.310.0000.00716.17
7.3.300.0040.00416.38
7.3.290.0120.00816.33
7.3.280.0090.01016.29
7.3.270.0060.01017.40
7.3.260.0120.00616.29
7.3.250.0170.00316.39
7.3.240.0170.00616.43
7.3.230.0140.01016.39
7.3.210.0130.00316.28
7.3.200.0090.00919.39
7.3.190.0140.00316.55
7.3.180.0040.01216.36
7.3.170.0060.01016.33
7.3.160.0080.00816.18
7.2.330.0070.01016.52
7.2.320.0130.01116.77
7.2.310.0100.00716.77
7.2.300.0090.00616.83
7.2.290.0100.00716.71
7.2.60.0060.00916.89
7.1.200.0070.00315.88
7.1.70.0000.01117.27
7.1.60.0000.02119.13
7.1.50.0070.01816.89
7.1.00.0070.07322.43
7.0.200.0030.00616.84
7.0.60.0000.08719.95
7.0.50.0130.07317.87
7.0.40.0130.07720.11
7.0.30.0170.03720.30
7.0.20.0400.07720.23
7.0.10.0000.04720.06
7.0.00.0070.05020.22
5.6.210.0170.06020.48
5.6.200.0130.07718.29
5.6.190.0070.08320.55
5.6.180.0500.06320.48
5.6.170.0100.05020.54
5.6.160.0030.09020.52
5.6.150.0200.07018.15
5.6.140.0100.07718.28
5.6.130.0070.08018.22
5.6.120.0130.04320.99
5.6.110.0030.06721.01
5.6.100.0100.04721.14
5.6.90.0100.03320.96
5.6.80.0000.07020.51
5.5.350.4230.05020.45
5.5.340.0030.04017.98
5.5.330.0070.05020.28
5.5.320.0030.08720.35
5.5.310.0300.04720.41
5.5.300.0170.07317.94
5.5.290.0100.04318.08
5.5.280.0100.08020.88
5.5.270.0130.07320.84
5.5.260.0030.08020.88
5.5.250.0100.07320.69
5.5.240.0100.08020.29
5.4.450.3770.03719.57
5.4.440.3470.03719.52
5.4.430.3330.06319.54
5.4.420.0030.04019.31
5.4.410.3600.03719.50
5.4.400.3630.04018.95
5.4.390.4070.04719.19
5.4.380.3900.03719.22
5.4.370.3670.03719.24
5.4.360.0800.06018.96
5.4.350.1300.07018.99
5.4.340.3800.04019.02
5.4.320.4000.04019.22
5.4.310.3430.03019.16
5.4.300.3570.04019.22
5.4.290.3970.03718.96
5.4.280.3630.03719.16
5.4.270.3430.04019.21
5.4.260.3530.04319.26
5.4.250.2700.04318.85
5.4.240.2830.04019.21
5.4.230.3300.04019.13
5.4.220.3370.03718.85
5.4.210.3100.03319.08
5.4.200.3230.03719.07
5.4.190.3970.04018.98
5.4.180.2870.04019.13
5.4.170.2870.03318.93
5.4.160.3870.04318.92
5.4.150.3870.03319.07
5.4.140.3800.03716.34
5.4.130.4000.03316.48
5.4.120.3570.03316.36
5.4.110.3630.03016.45
5.4.100.3570.03716.55
5.4.90.3470.02716.51
5.4.80.3900.03016.44
5.4.70.3800.03316.54
5.4.60.3370.03316.53
5.4.50.3670.03316.49
5.4.40.3670.03716.16
5.4.30.3700.03716.52
5.4.20.3600.03716.42
5.4.10.3670.03716.23
5.4.00.3600.03315.77
5.3.290.3830.03314.65
5.3.280.3530.04714.59
5.3.270.3100.04014.62
5.3.260.3400.04014.58
5.3.250.3800.03314.54
5.3.240.4130.04014.60
5.3.230.3730.03714.62
5.3.220.3430.03014.49
5.3.210.3300.03714.65
5.3.200.3400.04014.69
5.3.190.3570.04014.50
5.3.180.3530.02014.73
5.3.170.3670.03714.65
5.3.160.3100.03714.62
5.3.150.3430.03014.65
5.3.140.3670.03714.54
5.3.130.3630.03714.67
5.3.120.3530.03714.48
5.3.110.3370.04014.55
5.3.100.3870.04014.20
5.3.90.3830.03714.04
5.3.80.3930.04014.07
5.3.70.3730.04014.10
5.3.60.3900.03714.03
5.3.50.3970.02714.03
5.3.40.4330.03714.00
5.3.30.4030.03313.83
5.3.20.4500.03013.61
5.3.10.4070.04013.79
5.3.00.3470.03313.87
5.2.170.3630.02711.16
5.2.160.3670.02311.16
5.2.150.3700.03011.06
5.2.140.3100.03011.37
5.2.130.3700.02711.19
5.2.120.3770.02711.11
5.2.110.2800.03011.12
5.2.100.3470.02711.16
5.2.90.3100.03011.16
5.2.80.2900.03011.03
5.2.70.2870.03011.03
5.2.60.3000.02710.99
5.2.50.3300.03711.19
5.2.40.2130.02711.12
5.2.30.2830.02710.98
5.2.20.2970.03011.05
5.2.10.2930.02310.80
5.2.00.2400.03010.77
5.1.60.2300.0209.90
5.1.50.2330.0209.91
5.1.40.2670.0209.91
5.1.30.2500.02010.32
5.1.20.2070.02710.27
5.1.10.2700.02710.31
5.1.00.2470.02310.13
5.0.50.1470.0238.45
5.0.40.1300.0208.35
5.0.30.1230.0338.31
5.0.20.1370.0138.14
5.0.10.1330.0208.10
5.0.00.1130.0308.25
4.4.90.1100.0175.86
4.4.80.1370.0105.84
4.4.70.1270.0175.88
4.4.60.1430.0175.89
4.4.50.1200.0175.91
4.4.40.1200.0235.80
4.4.30.0870.0175.86
4.4.20.1430.0205.82
4.4.10.1330.0205.88
4.4.00.1270.0205.85
4.3.110.1300.0175.77
4.3.100.1570.0135.73
4.3.90.1100.0175.69
4.3.80.1230.0275.83
4.3.70.1300.0105.82
4.3.60.1330.0135.81
4.3.50.1600.0205.78
4.3.40.1330.0275.69
4.3.30.0730.0175.65
4.3.20.0770.0205.65
4.3.10.0900.0205.65
4.3.00.0670.0175.65

preferences:
61.36 ms | 401 KiB | 5 Q