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)); echo is_array($d) ? 'It\'s an array!' : 'Not an array.'; foreach($d as $key => $value) { echo "\n$key => $value"; }

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.0040.01118.68
8.3.50.0150.00516.69
8.3.40.0070.00718.79
8.3.30.0110.01118.83
8.3.20.0030.00518.90
8.3.10.0000.00820.65
8.3.00.0080.00017.63
8.2.180.0090.00616.75
8.2.170.0090.00622.96
8.2.160.0070.00722.13
8.2.150.0030.00624.18
8.2.140.0130.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00319.95
8.2.110.0100.00020.89
8.2.100.0080.00417.78
8.2.90.0030.00519.39
8.2.80.0060.00317.97
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0000.00718.21
8.2.20.0070.00017.60
8.2.10.0040.00417.68
8.2.00.0050.00317.68
8.1.280.0110.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0130.00020.52
8.1.230.0040.00820.88
8.1.220.0050.00518.77
8.1.210.0060.00318.96
8.1.200.0030.00617.35
8.1.190.0090.00017.66
8.1.180.0030.00618.10
8.1.170.0040.00418.84
8.1.160.0000.00718.94
8.1.150.0000.00818.57
8.1.140.0000.00817.38
8.1.130.0000.00817.75
8.1.120.0080.00017.31
8.1.110.0050.00217.31
8.1.100.0040.00417.50
8.1.90.0040.00417.30
8.1.80.0000.00717.46
8.1.70.0000.00717.42
8.1.60.0000.00817.59
8.1.50.0040.00417.45
8.1.40.0090.00017.54
8.1.30.0040.00417.68
8.1.20.0060.00317.65
8.1.10.0040.00417.56
8.1.00.0000.00817.46
8.0.300.0000.00719.91
8.0.290.0090.00016.75
8.0.280.0070.00018.46
8.0.270.0030.00317.27
8.0.260.0000.00718.64
8.0.250.0000.00816.98
8.0.240.0060.00616.98
8.0.230.0000.00717.01
8.0.220.0000.00716.89
8.0.210.0070.00016.84
8.0.200.0000.00717.04
8.0.190.0000.00716.99
8.0.180.0000.00716.90
8.0.170.0050.00516.83
8.0.160.0000.00816.86
8.0.150.0030.00616.76
8.0.140.0040.00716.90
8.0.130.0000.00513.38
8.0.120.0030.00516.85
8.0.110.0080.00016.82
8.0.100.0040.00416.98
8.0.90.0040.00416.92
8.0.80.0060.00916.93
8.0.70.0020.00516.74
8.0.60.0000.00716.72
8.0.50.0040.00416.94
8.0.30.0150.00817.21
8.0.20.0100.01017.16
8.0.10.0040.00416.96
8.0.00.0080.01516.91
7.4.330.0060.00014.84
7.4.320.0000.00716.49
7.4.300.0000.00616.62
7.4.290.0050.00316.52
7.4.280.0030.00616.63
7.4.270.0070.00016.52
7.4.260.0000.00513.21
7.4.250.0080.00016.60
7.4.240.0040.00416.52
7.4.230.0000.00716.62
7.4.220.0070.01416.58
7.4.210.0060.01016.60
7.4.200.0030.00316.64
7.4.190.0030.00316.39
7.4.160.0080.00816.64
7.4.150.0100.00717.07
7.4.140.0090.01017.21
7.4.130.0100.01016.49
7.4.120.0130.00516.49
7.4.110.0160.00616.57
7.4.100.0100.01016.51
7.4.90.0040.01416.43
7.4.80.0090.00918.80
7.4.70.0180.00316.65
7.4.60.0050.01016.57
7.4.50.0060.00316.57
7.4.40.0100.00322.27
7.4.30.0050.01316.66
7.4.00.0040.00415.16
7.3.330.0070.00013.18
7.3.320.0000.00813.12
7.3.310.0070.00016.27
7.3.300.0070.00016.33
7.3.290.0040.01116.32
7.3.280.0120.00616.37
7.3.270.0090.00917.07
7.3.260.0120.00618.24
7.3.250.0070.01116.47
7.3.240.0130.00516.41
7.3.230.0090.00916.61
7.3.210.0120.01216.37
7.3.200.0130.01019.39
7.3.190.0060.01316.29
7.3.180.0050.01416.32
7.3.170.0060.01216.63
7.3.160.0120.00416.52
7.3.120.0030.01214.87
7.2.330.0090.01016.68
7.2.320.0070.01716.50
7.2.310.0150.01416.46
7.2.300.0130.00416.85
7.2.290.0080.00816.46
7.2.60.0100.00716.88
7.2.00.0070.00719.23
7.1.200.0030.00715.69
7.1.100.0820.00316.10
7.1.70.0000.00716.95
7.1.60.0090.01519.40
7.1.50.0030.01916.72
7.1.00.0000.03722.51
7.0.200.0030.00716.76
7.0.140.0100.06722.09
7.0.60.0170.07320.10
7.0.50.0070.05017.85
7.0.40.0070.04017.75
7.0.30.0100.08017.80
7.0.20.0070.07017.71
7.0.10.0030.05017.77
7.0.00.0030.09317.84
5.6.280.0170.06320.79
5.6.210.0100.07720.56
5.6.200.0130.07018.19
5.6.190.0070.07718.14
5.6.180.0070.08018.17
5.6.170.0030.08018.18
5.6.160.0130.07318.19
5.6.150.0000.07718.20
5.6.140.0100.07018.25
5.6.130.0070.08718.18
5.6.120.0200.04018.14
5.6.110.0030.05718.16
5.6.100.0000.04718.25
5.6.90.0030.08318.11
5.6.80.0070.08317.54
5.6.70.0100.07017.53
5.6.60.0170.06317.57
5.6.50.0030.06317.54
5.6.40.0100.07717.53
5.6.30.0170.03717.54
5.6.20.0130.04717.54
5.6.10.0130.07017.54
5.6.00.0130.07017.53
5.5.350.0230.07720.39
5.5.340.0170.07318.09
5.5.330.0030.08317.98
5.5.320.0030.07018.09
5.5.310.0070.08318.08
5.5.300.0000.04718.03
5.5.290.0100.05718.10
5.5.280.0170.06017.98
5.5.270.0170.05017.98
5.5.260.0000.05318.02
5.5.250.0070.06717.77
5.5.240.0100.05317.47
5.5.230.0170.05717.41
5.5.220.0070.06017.36
5.5.210.0030.06017.45
5.5.200.0070.07317.36
5.5.190.0130.06717.43
5.5.180.0100.05017.34
5.5.160.0100.04717.34
5.5.150.0070.05017.32
5.5.140.0030.04017.36
5.5.130.0000.04017.30
5.5.120.0030.03717.42
5.5.110.0000.04017.31
5.5.100.0070.03317.21
5.5.90.0100.03017.19
5.5.80.0000.04017.20
5.5.70.0070.03317.29
5.5.60.0100.03017.32
5.5.50.0030.03717.20
5.5.40.0030.03717.22
5.5.30.0030.03717.21
5.5.20.0030.03717.17
5.5.10.0000.04017.19
5.5.00.0030.03717.21
5.4.450.0070.06019.37
5.4.440.0170.06719.46
5.4.430.0070.08019.34
5.4.420.0170.07719.37
5.4.410.0070.06319.29
5.4.400.0030.07719.02
5.4.390.0070.08319.10
5.4.380.0100.06719.10
5.4.370.0100.07319.01
5.4.360.0000.07019.04
5.4.350.0070.04718.98
5.4.340.0000.04319.14
5.4.320.0000.04319.27
5.4.310.0070.03719.02
5.4.300.0130.03019.08
5.4.290.0070.03719.03
5.4.280.0030.03718.98
5.4.270.0030.03719.04
5.4.260.0100.03719.12
5.4.250.0100.03019.09
5.4.240.0130.02719.12
5.4.230.0030.03719.06
5.4.220.0130.02719.10
5.4.210.0100.03019.02
5.4.200.0070.03319.09
5.4.190.0030.04018.88
5.4.180.0030.03719.01
5.4.170.0000.04018.94
5.4.160.0000.04019.04
5.4.150.0000.04019.27
5.4.140.0000.04016.31
5.4.130.0030.03316.47
5.4.120.0030.03316.39
5.4.110.0000.03716.49
5.4.100.0030.03316.43
5.4.90.0000.03716.39
5.4.80.0030.03316.40
5.4.70.0030.04016.41
5.4.60.0030.03716.46
5.4.50.0100.03716.46
5.4.40.0070.03016.40
5.4.30.0030.03316.52
5.4.20.0070.03016.32
5.4.10.0000.04016.26
5.4.00.0070.05715.81
5.3.290.0230.04014.71
5.3.280.0030.03714.66
5.3.270.0030.03714.63
5.3.260.0100.03014.62
5.3.250.0100.03014.61
5.3.240.0030.03314.66
5.3.230.0100.03014.66
5.3.220.0030.03714.42
5.3.210.0000.04014.53
5.3.200.0000.04014.64
5.3.190.0070.03314.60
5.3.180.0030.06314.78
5.3.170.0000.04014.62
5.3.160.0070.03314.60
5.3.150.0030.03314.65
5.3.140.0030.03314.52
5.3.130.0030.03714.55
5.3.120.0030.03714.65
5.3.110.0030.03714.60
5.3.100.0070.05314.09
5.3.90.0030.04013.99
5.3.80.0000.05314.08
5.3.70.0070.06714.07
5.3.60.0100.05714.07
5.3.50.0030.05713.96
5.3.40.0000.07314.00
5.3.30.0000.05013.98
5.3.20.0070.07313.69
5.3.10.0100.05013.70
5.3.00.0030.06013.69
5.2.170.0100.06011.20
5.2.160.0130.05711.20
5.2.150.0130.04011.00
5.2.140.0030.06311.15
5.2.130.0030.06711.12
5.2.120.0100.05711.10
5.2.110.0130.02311.17
5.2.100.0030.03711.00
5.2.90.0000.05311.10
5.2.80.0030.04011.16
5.2.70.0070.05311.13
5.2.60.0030.06710.93
5.2.50.0000.05010.88
5.2.40.0070.03710.99
5.2.30.0000.03311.02
5.2.20.0070.05710.96
5.2.10.0100.05010.83
5.2.00.0000.06710.72
5.1.60.0070.0579.98
5.1.50.0030.03010.11
5.1.40.0070.05010.11
5.1.30.0100.05010.45
5.1.20.0000.04010.39
5.1.10.0070.04010.30
5.1.00.0070.05710.12
5.0.50.0070.0409.12
5.0.40.0000.0509.12
5.0.30.0030.0479.12
5.0.20.0070.0439.12
5.0.10.0030.0439.12
5.0.00.0000.0679.12
4.4.90.0130.0279.12
4.4.80.0170.0209.12
4.4.70.0000.0279.12
4.4.60.0030.0179.12
4.4.50.0100.0309.12
4.4.40.0070.0509.12
4.4.30.0100.0179.12
4.4.20.0000.0409.12
4.4.10.0030.0309.12
4.4.00.0030.0539.12
4.3.110.0000.0379.12
4.3.100.0030.0279.12
4.3.90.0000.0339.12
4.3.80.0000.0479.12
4.3.70.0000.0209.12
4.3.60.0000.0239.12
4.3.50.0000.0409.12
4.3.40.0070.0279.12
4.3.30.0000.0209.12
4.3.20.0030.0379.12
4.3.10.0030.0309.12
4.3.00.0000.0339.12

preferences:
40.98 ms | 401 KiB | 5 Q