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 $d instanceof Traversable ? '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.0070.01116.63
8.3.50.0080.01021.97
8.3.40.0060.00918.73
8.3.30.0030.01019.21
8.3.20.0040.00420.30
8.3.10.0080.00023.64
8.3.00.0070.00022.51
8.2.180.0130.00316.88
8.2.170.0090.00622.96
8.2.160.0030.01219.13
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0070.00022.29
8.2.110.0040.00719.24
8.2.100.0120.00017.84
8.2.90.0040.00419.31
8.2.80.0050.00317.97
8.2.70.0090.00017.75
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0000.00819.52
8.2.30.0000.00718.00
8.2.20.0080.00017.68
8.2.10.0000.00817.70
8.2.00.0000.00817.75
8.1.280.0090.00625.92
8.1.270.0030.00623.95
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00322.67
8.1.230.0070.00417.77
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0070.00317.48
8.1.190.0000.00917.54
8.1.180.0030.00518.10
8.1.170.0060.00318.66
8.1.160.0070.00021.92
8.1.150.0000.00918.63
8.1.140.0050.00317.51
8.1.130.0070.00017.84
8.1.120.0040.00417.41
8.1.110.0070.00017.49
8.1.100.0000.00717.45
8.1.90.0030.00517.50
8.1.80.0030.00317.50
8.1.70.0000.00717.30
8.1.60.0030.00517.44
8.1.50.0030.00617.48
8.1.40.0040.00417.37
8.1.30.0000.00817.58
8.1.20.0050.00317.76
8.1.10.0000.00817.52
8.1.00.0060.00317.47
8.0.300.0080.00018.77
8.0.290.0070.00016.75
8.0.280.0040.00418.41
8.0.270.0080.00017.23
8.0.260.0040.00416.74
8.0.250.0000.00717.02
8.0.240.0040.00416.98
8.0.230.0040.00416.98
8.0.220.0000.00716.89
8.0.210.0070.00316.84
8.0.200.0040.00416.94
8.0.190.0040.00416.87
8.0.180.0000.00717.00
8.0.170.0000.00816.94
8.0.160.0040.00417.00
8.0.150.0030.00316.81
8.0.140.0000.00716.90
8.0.130.0030.00613.32
8.0.120.0040.00416.88
8.0.110.0040.00416.91
8.0.100.0000.00816.86
8.0.90.0040.00416.77
8.0.80.0120.00616.93
8.0.70.0040.00416.90
8.0.60.0000.00816.81
8.0.50.0050.00316.89
8.0.30.0100.01017.07
8.0.20.0080.01117.40
8.0.10.0030.00516.97
8.0.00.0060.01416.86
7.4.330.0000.00515.03
7.4.320.0040.00416.63
7.4.300.0000.00616.46
7.4.290.0040.00416.43
7.4.280.0030.00516.41
7.4.270.0060.00316.45
7.4.260.0090.00016.48
7.4.250.0000.00716.60
7.4.240.0050.00216.59
7.4.230.0070.00016.32
7.4.220.0190.00016.58
7.4.210.0100.00816.53
7.4.200.0040.00416.62
7.4.190.0000.00716.65
7.4.160.0120.00916.59
7.4.150.0070.01017.40
7.4.140.0090.00917.86
7.4.130.0090.01316.58
7.4.120.0120.00616.44
7.4.110.0030.01416.40
7.4.100.0090.00916.54
7.4.90.0030.01416.49
7.4.80.0140.00319.39
7.4.70.0110.01116.57
7.4.60.0060.01016.55
7.4.50.0000.00816.56
7.4.40.0100.00322.77
7.4.30.0130.00316.56
7.4.00.0060.00915.22
7.3.330.0040.00413.33
7.3.320.0000.00613.37
7.3.310.0070.00016.18
7.3.300.0000.00716.23
7.3.290.0090.01216.33
7.3.280.0100.01016.32
7.3.270.0130.00317.40
7.3.260.0060.01316.68
7.3.250.0150.00616.48
7.3.240.0150.00616.43
7.3.230.0070.01116.39
7.3.210.0130.00616.48
7.3.200.0110.00619.39
7.3.190.0120.00616.36
7.3.180.0090.00616.50
7.3.170.0150.00316.41
7.3.160.0190.00316.27
7.3.120.0060.00614.72
7.2.330.0030.01616.62
7.2.320.0070.01016.61
7.2.310.0140.00416.73
7.2.300.0030.01416.84
7.2.290.0030.01416.94
7.1.70.0000.00817.04
7.1.60.0120.01219.29
7.1.50.0090.01216.99
7.1.00.0100.07022.46
7.0.200.0080.00816.45
7.0.140.0030.07321.96
7.0.60.0070.05020.03
7.0.50.0000.05718.04
7.0.40.0030.04320.11
7.0.30.0270.08020.28
7.0.20.0370.07320.16
7.0.10.0230.08320.15
7.0.00.0130.05720.08
5.6.280.0000.07720.87
5.6.210.0030.06020.48
5.6.200.0130.06018.16
5.6.190.0200.08020.41
5.6.180.0070.08020.68
5.6.170.0100.04720.57
5.6.160.0070.06720.51
5.6.150.0030.05318.18
5.6.140.0030.07018.21
5.6.130.0100.07718.21
5.6.120.0130.06321.15
5.6.110.0070.08721.02
5.6.100.0030.05720.98
5.6.90.0070.07021.13
5.6.80.0100.03320.39
5.6.70.0330.07020.42
5.5.350.0030.07020.42
5.5.340.0130.03317.99
5.5.330.0100.05320.32
5.5.320.0070.07720.34
5.5.310.0370.06020.41
5.5.300.0130.03018.10
5.5.290.0070.08017.93
5.5.280.0000.09320.77
5.5.270.0100.05720.87
5.5.260.0170.04720.89
5.5.250.0070.08320.69
5.5.240.0000.06320.27
5.4.450.0870.04319.42
5.4.440.0100.07319.45
5.4.430.0270.07719.45
5.4.420.0230.07019.45
5.4.410.0130.06319.04
5.4.400.0200.07318.67
5.4.390.0200.07718.63
5.4.380.0170.05318.70
5.4.370.0500.07018.48
5.4.360.0370.04718.57
5.4.350.0400.05318.84
5.4.340.0630.08018.76
5.4.320.0090.05312.51
5.4.310.0050.03812.51
5.4.300.0080.04112.52
5.4.290.0090.04412.51
5.4.280.0100.04712.38
5.4.270.0080.04812.38
5.4.260.0150.06412.38
5.4.250.0230.09112.38
5.4.240.0160.06412.38
5.4.230.0110.06512.37
5.4.220.0110.08312.37
5.4.210.0110.04512.37
5.4.200.0130.05712.37
5.4.190.0070.04612.37
5.4.180.0070.03712.36
5.4.170.0070.03712.38
5.4.160.0090.03612.38
5.4.150.0070.03812.37
5.4.140.0060.04012.05
5.4.130.0060.03812.04
5.4.120.0110.03612.00
5.4.110.0150.05912.00
5.4.100.0060.06211.99
5.4.90.0100.06311.99
5.4.80.0090.05012.00
5.4.70.0070.04211.99
5.4.60.0080.03612.00
5.4.50.0050.04812.00
5.4.40.0020.05711.98
5.4.30.0100.05911.98
5.4.20.0110.05311.98
5.4.10.0050.04211.98
5.4.00.0080.03811.47
5.3.290.0050.04112.80
5.3.280.0090.04112.70
5.3.270.0060.04412.72
5.3.260.0090.04712.72
5.3.250.0070.05212.72
5.3.240.0090.04712.72
5.3.230.0090.05512.71
5.3.220.0120.04912.68
5.3.210.0100.05212.68
5.3.200.0070.05112.68
5.3.190.0080.04412.68
5.3.180.0070.03912.67
5.3.170.0080.03712.67
5.3.160.0070.03812.67
5.3.150.0110.03412.67
5.3.140.0050.04312.66
5.3.130.0040.04412.66
5.3.120.0030.06012.66
5.3.110.0170.09112.66
5.3.100.0140.05312.12
5.3.90.0090.04712.09
5.3.80.0070.04812.08
5.3.70.0090.04712.07
5.3.60.0080.05412.06
5.3.50.0120.04112.00
5.3.40.0120.06312.00
5.3.30.0070.04211.97
5.3.20.0080.03611.75
5.3.10.0090.03311.71
5.3.00.0080.03811.71
5.2.170.0080.0309.20
5.2.160.0050.0429.20
5.2.150.0070.0449.20
5.2.140.0030.0479.20
5.2.130.0060.0439.16
5.2.120.0060.0309.16
5.2.110.0070.0419.16
5.2.100.0020.0379.16
5.2.90.0100.0539.16
5.2.80.0100.0419.16
5.2.70.0090.0589.16
5.2.60.0080.0359.11
5.2.50.0070.0349.08
5.2.40.0060.0329.05
5.2.30.0110.0619.04
5.2.20.0220.0429.02
5.2.10.0050.0318.93
5.2.00.0040.0368.80
5.1.60.0090.0258.09
5.1.50.0130.0588.09
5.1.40.0090.0318.07
5.1.30.0140.0368.42
5.1.20.0050.0618.44
5.1.10.0090.0818.17
5.1.00.0080.0388.17
5.0.50.0060.0316.61
5.0.40.0060.0276.48
5.0.30.0060.0416.29
5.0.20.0040.0266.26
5.0.10.0050.0276.24
5.0.00.0040.0386.23
4.4.90.0040.0154.78
4.4.80.0040.0154.75
4.4.70.0030.0164.75
4.4.60.0040.0144.75
4.4.50.0040.0154.77
4.4.40.0040.0254.71
4.4.30.0040.0164.76
4.4.20.0060.0214.85
4.4.10.0030.0224.85
4.4.00.0040.0314.76
4.3.110.0040.0294.66
4.3.100.0020.0184.66
4.3.90.0020.0164.63
4.3.80.0030.0274.58
4.3.70.0010.0174.63
4.3.60.0030.0164.63
4.3.50.0030.0164.63
4.3.40.0020.0294.54
4.3.30.0050.0143.28
4.3.20.0000.0193.27
4.3.10.0060.0243.23
4.3.00.0200.01013.64

preferences:
47.49 ms | 401 KiB | 5 Q