3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Derp implements Iterator { protected $index; protected $array; public function __construct(array $input) { $this->array = $input; } public function current() { return $this->array[$this->index]; } public function next() { $this->index += 1; } public function key() { return $this->index; } public function valid() { return isset($this->array[$this->index]); } public function rewind() { $this->index = 0; } } $d = new Derp(range(1,100)); var_dump(is_array($d)); foreach($d as $key => $value) { echo "$key => $value\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.0070.00716.75
8.3.50.0130.00716.50
8.3.40.0090.00618.85
8.3.30.0110.01118.79
8.3.20.0120.00618.90
8.3.10.0040.00420.68
8.3.00.0040.00419.50
8.2.180.0180.00316.63
8.2.170.0120.00622.96
8.2.160.0090.00621.20
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0080.00019.18
8.2.110.0060.00320.35
8.2.100.0120.00017.91
8.2.90.0040.00419.20
8.2.80.0000.00719.39
8.2.70.0060.00317.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0090.00018.16
8.2.30.0000.00718.11
8.2.20.0030.00517.73
8.2.10.0040.00417.69
8.2.00.0080.00017.75
8.1.280.0100.00725.92
8.1.270.0070.00024.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00321.82
8.1.230.0070.00420.96
8.1.220.0050.00318.77
8.1.210.0050.00318.97
8.1.200.0040.00417.36
8.1.190.0040.00417.63
8.1.180.0040.00418.10
8.1.170.0030.00618.89
8.1.160.0030.00618.78
8.1.150.0000.01018.70
8.1.140.0040.00417.50
8.1.130.0030.00317.71
8.1.120.0000.00717.49
8.1.110.0030.00517.48
8.1.100.0030.00517.37
8.1.90.0070.00017.46
8.1.80.0040.00417.48
8.1.70.0030.00317.49
8.1.60.0050.00317.50
8.1.50.0060.00317.36
8.1.40.0040.00417.57
8.1.30.0070.00017.69
8.1.20.0000.00817.73
8.1.10.0040.00417.51
8.1.00.0040.00417.41
8.0.300.0050.00319.94
8.0.290.0040.00416.75
8.0.280.0070.00018.38
8.0.270.0040.00417.21
8.0.260.0040.00416.83
8.0.250.0030.00516.97
8.0.240.0040.00416.96
8.0.230.0030.00316.93
8.0.220.0070.00016.90
8.0.210.0000.00816.89
8.0.200.0000.00616.99
8.0.190.0040.00416.83
8.0.180.0030.00516.95
8.0.170.0060.00316.89
8.0.160.0000.00716.91
8.0.150.0000.00916.80
8.0.140.0000.01316.93
8.0.130.0030.00313.43
8.0.120.0030.00516.77
8.0.110.0000.00816.88
8.0.100.0030.00517.02
8.0.90.0020.00516.78
8.0.80.0070.01416.91
8.0.70.0060.00316.97
8.0.60.0000.00716.93
8.0.50.0040.00416.73
8.0.30.0150.00717.23
8.0.20.0120.01117.17
8.0.10.0040.00416.90
8.0.00.0090.01516.79
7.4.330.0000.00513.02
7.4.320.0000.00616.43
7.4.300.0060.00016.44
7.4.290.0100.00016.43
7.4.280.0000.00816.38
7.4.270.0000.00716.51
7.4.260.0000.00613.28
7.4.250.0030.00616.58
7.4.240.0070.00016.57
7.4.230.0000.00716.46
7.4.220.0120.02116.61
7.4.210.0050.01116.52
7.4.200.0050.00316.67
7.4.190.0000.00716.38
7.4.160.0090.00616.53
7.4.150.0120.00816.46
7.4.140.0140.00716.57
7.4.130.0080.01116.53
7.4.120.0070.01116.41
7.4.110.0070.01116.39
7.4.100.0120.00616.51
7.4.90.0100.00716.68
7.4.80.0040.01319.39
7.4.70.0060.01516.53
7.4.60.0110.00416.60
7.4.50.0040.00816.56
7.4.40.0110.00016.39
7.4.30.0060.01116.57
7.4.00.0100.00714.99
7.3.330.0030.00313.24
7.3.320.0000.00613.36
7.3.310.0000.00716.41
7.3.300.0070.00016.25
7.3.290.0130.00716.41
7.3.280.0080.00816.32
7.3.270.0210.02316.60
7.3.260.0090.00916.67
7.3.250.0070.01216.53
7.3.240.0130.00616.56
7.3.230.0040.01416.59
7.3.210.0110.00716.27
7.3.200.0060.01316.52
7.3.190.0070.01416.43
7.3.180.0070.01016.60
7.3.170.0080.00816.57
7.3.160.0130.00416.36
7.3.120.0060.01114.82
7.2.330.0150.00416.79
7.2.320.0140.00416.83
7.2.310.0060.01216.68
7.2.300.0060.01316.75
7.2.290.0170.00316.78
7.2.120.0040.01216.41
7.2.110.0030.00616.62
7.2.100.0130.00016.85
7.2.90.0030.00916.85
7.2.80.0000.00916.47
7.2.70.0000.01716.94
7.2.60.0040.01116.93
7.2.50.0150.00017.02
7.2.40.0060.01016.95
7.2.30.0130.00316.97
7.2.20.0000.01316.94
7.2.10.0110.00017.02
7.2.00.0050.01018.11
7.1.240.0100.00315.92
7.1.230.0040.00915.87
7.1.220.0090.00315.48
7.1.210.0030.00915.63
7.1.200.0060.00915.66
7.1.190.0030.01015.64
7.1.180.0040.00815.96
7.1.170.0100.00615.54
7.1.160.0000.01415.86
7.1.150.0030.01315.78
7.1.140.0000.01315.91
7.1.130.0070.00715.84
7.1.120.0040.01115.88
7.1.110.0110.00315.91
7.1.100.0080.00815.73
7.1.90.0080.00315.78
7.1.80.0070.00715.66
7.1.70.0050.00816.53
7.1.60.0050.01317.44
7.1.50.0030.01016.28
7.1.40.0070.00415.94
7.1.30.0090.00315.67
7.1.20.0080.00015.65
7.1.10.0000.01215.54
7.1.00.0050.02519.00
7.0.320.0030.00915.29
7.0.310.0090.00615.16
7.0.300.0040.00415.41
7.0.290.0090.00315.44
7.0.280.0030.00515.36
7.0.270.0140.00015.24
7.0.260.0060.00615.44
7.0.250.0070.00715.41
7.0.240.0080.00815.46
7.0.230.0040.00815.23
7.0.220.0070.00615.42
7.0.210.0090.00315.47
7.0.200.0040.00715.83
7.0.190.0060.00315.55
7.0.180.0030.00915.48
7.0.170.0030.00915.36
7.0.160.0100.00315.55
7.0.150.0040.00715.48
7.0.140.0080.03818.59
7.0.130.0080.00515.36
7.0.120.0030.04018.74
7.0.110.0050.00915.52
7.0.100.0100.00315.25
7.0.90.0100.00615.11
7.0.80.0000.01315.54
7.0.70.0030.00615.37
7.0.60.0090.04017.59
7.0.50.0070.02716.81
7.0.40.0080.04215.76
7.0.30.0060.02115.42
7.0.20.0020.03415.67
7.0.10.0030.03015.66
7.0.00.0020.02915.67
5.6.380.0040.01114.45
5.6.370.0080.00414.52
5.6.360.0040.01114.60
5.6.350.0000.01214.47
5.6.340.0090.00614.76
5.6.330.0100.00314.47
5.6.320.0100.00714.51
5.6.310.0040.00814.72
5.6.300.0030.00714.29
5.6.290.0060.01014.45
5.6.280.0000.01314.68
5.6.270.0090.00614.29
5.6.260.0080.00014.37
5.6.250.0090.00014.54
5.6.240.0030.01014.31
5.6.230.0030.00914.28
5.6.220.0090.00614.50
5.6.210.0060.04317.54
5.6.200.0020.03316.45
5.6.190.0100.04016.36
5.6.180.0090.04416.33
5.6.170.0070.03416.23
5.6.160.0050.02816.25
5.6.150.0080.04016.36
5.6.140.0070.04516.33
5.6.130.0050.03216.23
5.6.120.0060.02616.27
5.6.110.0070.04116.28
5.6.100.0030.02716.37
5.6.90.0040.03916.17
5.6.80.0040.03116.00
5.6.70.0070.04116.04
5.6.60.0090.02816.12
5.6.50.0050.04515.89
5.6.40.0040.04515.93
5.6.30.0080.04015.81
5.6.20.0020.02916.01
5.6.10.0020.03015.83
5.6.00.0050.03415.81
5.5.380.0030.00711.09
5.5.370.0030.00711.33
5.5.360.0070.00311.23
5.5.350.0170.04015.92
5.5.340.0010.02614.75
5.5.330.0060.04514.58
5.5.320.0090.02314.47
5.5.310.0050.03514.77
5.5.300.0030.02914.50
5.5.290.0060.04014.59
5.5.280.0070.03214.47
5.5.270.0030.04314.69
5.5.260.0060.02314.71
5.5.250.0030.03814.60
5.5.240.0100.03314.21
5.5.230.0070.02814.42
5.5.220.0080.03314.34
5.5.210.0070.02214.37
5.5.200.0100.03714.23
5.5.190.0040.04214.29
5.5.180.0060.02214.41
5.5.170.0000.00914.68
5.5.160.0000.04714.27
5.5.150.0080.04014.29
5.5.140.0020.04614.42
5.5.130.0090.04214.36
5.5.120.0010.04314.42
5.5.110.0030.04714.33
5.5.100.0080.02814.36
5.5.90.0070.04214.14
5.5.80.0080.03813.97
5.5.70.0100.03714.03
5.5.60.0060.04114.33
5.5.50.0060.04114.26
5.5.40.0030.03814.30
5.5.30.0050.04014.24
5.5.20.0070.03114.27
5.5.10.0100.03714.31
5.5.00.0020.02814.27
5.4.450.0020.03015.10
5.4.440.0080.03515.37
5.4.430.0100.03315.13
5.4.420.0050.02215.37
5.4.410.0020.04015.23
5.4.400.0070.03915.04
5.4.390.0090.04015.00
5.4.380.0040.04515.02
5.4.370.0040.02815.12
5.4.360.0130.02214.94
5.4.350.0080.04315.06
5.4.340.0050.04315.04
5.4.330.0060.00611.10
5.4.320.0110.03315.21
5.4.310.0110.03715.09
5.4.300.0080.03315.20
5.4.290.0050.03515.12
5.4.280.0090.02715.08
5.4.270.0050.03815.10
5.4.260.0070.04214.95
5.4.250.0070.02715.13
5.4.240.0100.03715.15
5.4.230.0060.04315.05
5.4.220.0070.03015.11
5.4.210.0050.03715.12
5.4.200.0100.03015.27
5.4.190.0050.04214.91
5.4.180.0050.03915.05
5.4.170.0050.04314.94
5.4.160.0020.04215.20
5.4.150.0060.03915.22
5.4.140.0070.03313.68
5.4.130.0030.03613.60
5.4.120.0020.04413.81
5.4.110.0090.03313.79
5.4.100.0080.03513.86
5.4.90.0050.04314.04
5.4.80.0090.01913.74
5.4.70.0030.03313.86
5.4.60.0090.01713.75
5.4.50.0050.02113.70
5.4.40.0040.02013.96
5.4.30.0020.02213.70
5.4.20.0030.02613.79
5.4.10.0000.02113.94
5.4.00.0050.01713.59
5.3.290.0050.02612.77
5.3.280.0080.02312.61
5.3.270.0050.02812.46
5.3.260.0080.03812.53
5.3.250.0020.03512.49
5.3.240.0100.03212.64
5.3.230.0080.02712.58
5.3.220.0110.03512.51
5.3.210.0070.02812.62
5.3.200.0050.03912.56
5.3.190.0080.04012.45
5.3.180.0050.03512.68
5.3.170.0080.01812.65
5.3.160.0050.02212.70
5.3.150.0020.02312.65
5.3.140.0100.01512.41
5.3.130.0050.01812.50
5.3.120.0030.02312.58
5.3.110.0030.02212.57
5.3.100.0020.02512.22
5.3.90.0050.02112.21
5.3.80.0020.02212.30
5.3.70.0030.02212.33
5.3.60.0070.01612.29
5.3.50.0020.02112.31
5.3.40.0010.02312.31
5.3.30.0020.02212.26
5.3.20.0050.02012.19
5.3.10.0070.01711.94
5.3.00.0050.01812.04
5.2.170.0060.01410.51
5.2.160.0070.01410.53
5.2.150.0020.02010.52
5.2.140.0020.01810.50
5.2.130.0050.01510.42
5.2.120.0030.01510.58
5.2.110.0060.01410.49
5.2.100.0020.01810.42
5.2.90.0050.01510.50
5.2.80.0050.01510.46
5.2.70.0050.01510.48
5.2.60.0070.01310.50
5.2.50.0020.01810.45
5.2.40.0060.01310.45
5.2.30.0030.01710.37
5.2.20.0030.02010.41
5.2.10.0030.01510.40
5.2.00.0040.01910.30
5.1.60.0050.0129.95
5.1.50.0050.0159.95
5.1.40.0040.0119.90
5.1.30.0050.01210.13
5.1.20.0090.00810.13
5.1.10.0050.0139.92
5.1.00.0020.0159.96
5.0.50.0030.0149.18
5.0.40.0000.0139.14
5.0.30.0020.0189.01
5.0.20.0020.0129.00
5.0.10.0030.0258.92
5.0.00.0020.0339.02
4.4.90.0030.0118.85
4.4.80.0000.0108.85
4.4.70.0010.0108.85
4.4.60.0030.0088.85
4.4.50.0000.0128.85
4.4.40.0020.0138.85
4.4.30.0020.0108.85
4.4.20.0020.0128.85
4.4.10.0020.0108.85
4.4.00.0020.0138.85
4.3.110.0060.0058.85
4.3.100.0000.0118.85
4.3.90.0000.0178.85
4.3.80.0050.0258.85
4.3.70.0050.0178.85
4.3.60.0010.0148.85
4.3.50.0030.0208.85
4.3.40.0020.0258.85
4.3.30.0020.0228.85
4.3.20.0050.0188.85
4.3.10.0020.0188.85
4.3.00.0030.0138.85

preferences:
48.69 ms | 401 KiB | 5 Q