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() { var_dump(__METHOD__); $this->position = 0; } function current() { var_dump(__METHOD__); return $this->array[$this->position]; } function key() { var_dump(__METHOD__); return $this->position; } function next() { var_dump(__METHOD__); ++$this->position; } function valid() { var_dump(__METHOD__); return isset($this->array[$this->position]); } } $it = new myIterator; foreach($it as $key => $value) { var_dump($key, $value); echo "\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.0120.00316.75
8.3.50.0110.01222.90
8.3.40.0090.00618.92
8.3.30.0140.00019.21
8.3.20.0040.00420.29
8.3.10.0040.00423.48
8.3.00.0040.00419.42
8.2.180.0150.00018.18
8.2.170.0040.01522.96
8.2.160.0040.01120.43
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.01426.16
8.2.120.0030.00620.85
8.2.110.0030.00721.10
8.2.100.0040.00717.91
8.2.90.0060.00317.98
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0080.00017.93
8.2.50.0030.00718.07
8.2.40.0030.00918.34
8.2.30.0020.00518.23
8.2.20.0000.00817.86
8.2.10.0000.00818.02
8.2.00.0070.00017.79
8.1.280.0090.01225.92
8.1.270.0060.00323.96
8.1.260.0050.00226.35
8.1.250.0050.00328.09
8.1.240.0060.00322.41
8.1.230.0060.00621.04
8.1.220.0050.00317.74
8.1.210.0040.00418.85
8.1.200.0070.00317.36
8.1.190.0040.00417.36
8.1.180.0030.00518.10
8.1.170.0080.00018.59
8.1.160.0000.00722.03
8.1.150.0000.00718.91
8.1.140.0000.00717.52
8.1.130.0000.00717.83
8.1.120.0070.00017.44
8.1.110.0040.00417.31
8.1.100.0030.00617.39
8.1.90.0000.00717.45
8.1.80.0030.00717.49
8.1.70.0030.00317.33
8.1.60.0040.00417.58
8.1.50.0000.00817.61
8.1.40.0060.00317.52
8.1.30.0040.00417.55
8.1.20.0040.00417.57
8.1.10.0040.00417.54
8.1.00.0050.00217.46
8.0.300.0040.00419.92
8.0.290.0000.00716.75
8.0.280.0000.00718.47
8.0.270.0040.00417.27
8.0.260.0070.00017.16
8.0.250.0020.00516.97
8.0.240.0040.00416.85
8.0.230.0030.00317.01
8.0.220.0030.00316.97
8.0.210.0030.00316.80
8.0.200.0000.00616.90
8.0.190.0060.00317.03
8.0.180.0050.00316.97
8.0.170.0000.00816.86
8.0.160.0040.00416.88
8.0.150.0000.00716.76
8.0.140.0000.00816.77
8.0.130.0030.00313.33
8.0.120.0040.00416.86
8.0.110.0040.00416.89
8.0.100.0050.00216.95
8.0.90.0000.00717.00
8.0.80.0100.00616.88
8.0.70.0000.00716.87
8.0.60.0040.00416.92
8.0.50.0000.00716.80
8.0.30.0080.01217.14
8.0.20.0140.00417.40
8.0.10.0040.00416.85
8.0.00.0090.00916.67
7.4.330.0000.00515.05
7.4.320.0000.00716.61
7.4.300.0060.00016.57
7.4.290.0030.00316.54
7.4.280.0040.00416.41
7.4.270.0040.00416.52
7.4.260.0000.00716.56
7.4.250.0050.00316.54
7.4.240.0000.00716.43
7.4.230.0000.00716.69
7.4.220.0070.01016.67
7.4.210.0090.00616.64
7.4.200.0000.00716.53
7.4.160.0040.01416.48
7.4.150.0170.00317.40
7.4.140.0120.00717.86
7.4.130.0110.00616.53
7.4.120.0140.00416.52
7.4.110.0130.00516.48
7.4.100.0090.01516.49
7.4.90.0030.01616.36
7.4.80.0120.01119.39
7.4.70.0100.00716.45
7.4.60.0090.00916.67
7.4.50.0000.00416.49
7.4.40.0070.01016.24
7.4.30.0030.01416.50
7.4.00.0070.00314.91
7.3.330.0000.00513.38
7.3.320.0030.00313.25
7.3.310.0070.00016.23
7.3.300.0030.00316.35
7.3.290.0070.01016.35
7.3.280.0080.00916.35
7.3.270.0030.01317.40
7.3.260.0130.01016.56
7.3.250.0110.00716.40
7.3.240.0060.01216.48
7.3.230.0140.00416.64
7.3.210.0120.01216.37
7.3.200.0060.01119.39
7.3.190.0070.01016.78
7.3.180.0100.01316.53
7.3.170.0130.00316.41
7.3.160.0100.00616.57
7.2.330.0120.00916.76
7.2.320.0070.01016.83
7.2.310.0090.01216.83
7.2.300.0130.00316.72
7.2.290.0030.01416.73
7.2.60.0060.00616.80
7.2.00.0110.00419.46
7.1.200.0080.00415.71
7.1.100.0100.00318.29
7.1.70.0040.00417.19
7.1.60.0070.01319.40
7.1.50.0090.00616.97
7.1.00.0070.07322.36
7.0.200.0050.00216.54
7.0.140.0030.07322.12
7.0.60.0000.08319.86
7.0.50.0030.04717.73
7.0.40.0100.08320.04
7.0.30.0330.04320.24
7.0.20.0200.05320.10
7.0.10.0030.04320.08
7.0.00.0170.07020.30
5.6.280.0100.06321.09
5.6.210.0100.06020.45
5.6.200.0070.04718.20
5.6.190.0100.07320.55
5.6.180.0030.08320.39
5.6.170.0370.05320.71
5.6.160.0100.07020.44
5.6.150.0030.08318.27
5.6.140.0000.06018.19
5.6.130.0070.04718.18
5.6.120.0030.09021.00
5.6.110.0170.07020.97
5.6.100.0030.09320.90
5.6.90.0070.09020.98
5.6.80.0030.08020.50
5.5.350.0030.04320.34
5.5.340.0070.08017.96
5.5.330.0070.08020.27
5.5.320.0230.04020.36
5.5.310.0330.07720.33
5.5.300.0030.07018.01
5.5.290.0130.07717.99
5.5.280.0170.07320.89
5.5.270.0070.08020.69
5.5.260.0170.07320.91
5.5.250.0000.05720.56
5.5.240.0230.07020.30
5.4.450.0230.05019.50
5.4.440.0470.05019.31
5.4.430.0270.04319.29
5.4.420.0570.03319.46
5.4.410.0470.03719.39
5.4.400.0400.03719.08
5.4.390.0130.04719.00
5.4.380.0630.06718.65
5.4.370.0830.05018.51
5.4.360.0970.05718.59
5.4.350.0900.05718.52
5.4.340.0670.05718.51
5.4.320.0050.03712.51
5.4.310.0050.03812.50
5.4.300.0050.03612.50
5.4.290.0070.03612.50
5.4.280.0070.03612.40
5.4.270.0080.03712.40
5.4.260.0070.03512.40
5.4.250.0050.03712.40
5.4.240.0050.03712.40
5.4.230.0080.03512.39
5.4.220.0060.03912.39
5.4.210.0040.03612.39
5.4.200.0040.04012.39
5.4.190.0090.03412.39
5.4.180.0080.03412.39
5.4.170.0030.03812.40
5.4.160.0060.03512.39
5.4.150.0060.03512.39
5.4.140.0040.03912.08
5.4.130.0090.03312.07
5.4.120.0090.03812.02
5.4.110.0070.03712.02
5.4.100.0090.03612.02
5.4.90.0090.03812.02
5.4.80.0080.03912.02
5.4.70.0070.03612.02
5.4.60.0070.03312.02
5.4.50.0100.03312.02
5.4.40.0060.03912.00
5.4.30.0060.03612.00
5.4.20.0080.03512.00
5.4.10.0050.03612.00
5.4.00.0040.03711.49
5.3.290.0020.04212.80
5.3.280.0030.03912.71
5.3.270.0050.03912.72
5.3.260.0060.03912.72
5.3.250.0060.03712.72
5.3.240.0090.03512.72
5.3.230.0060.04112.71
5.3.220.0100.03912.68
5.3.210.0070.03812.68
5.3.200.0090.04012.68
5.3.190.0070.03712.68
5.3.180.0110.03512.67
5.3.170.0040.04012.67
5.3.160.0070.04712.68
5.3.150.0120.03612.67
5.3.140.0050.04112.66
5.3.130.0100.03512.66
5.3.120.0070.04512.66
5.3.110.0070.03712.66
5.3.100.0070.03912.13
5.3.90.0060.03712.11
5.3.80.0110.03112.10
5.3.70.0050.03712.11
5.3.60.0060.03712.09
5.3.50.0070.04412.04
5.3.40.0090.03812.04
5.3.30.0050.03711.99
5.3.20.0050.04211.77
5.3.10.0110.03911.76
5.3.00.0070.03811.73
5.2.170.0060.0359.23
5.2.160.0050.0299.23
5.2.150.0020.0329.23
5.2.140.0070.0319.22
5.2.130.0070.0399.19
5.2.120.0050.0329.18
5.2.110.0050.0289.20
5.2.100.0080.0259.19
5.2.90.0010.0329.19
5.2.80.0060.0319.18
5.2.70.0070.0289.18
5.2.60.0060.0289.14
5.2.50.0040.0369.11
5.2.40.0070.0359.09
5.2.30.0070.0299.06
5.2.20.0050.0279.05
5.2.10.0060.0348.95
5.2.00.0030.0308.81
5.1.60.0020.0278.10
5.1.50.0020.0298.10
5.1.40.0030.0258.07
5.1.30.0040.0298.42
5.1.20.0040.0318.45
5.1.10.0050.0308.18
5.1.00.0050.0298.18
5.0.50.0080.0366.65
5.0.40.0050.0206.52
5.0.30.0060.0346.32
5.0.20.0020.0216.29
5.0.10.0010.0226.27
5.0.00.0080.0276.26
4.4.90.0030.0154.78
4.4.80.0040.0194.75
4.4.70.0010.0254.75
4.4.60.0040.0194.76
4.4.50.0030.0214.77
4.4.40.0020.0274.71
4.4.30.0030.0154.76
4.4.20.0030.0184.84
4.4.10.0050.0204.85
4.4.00.0030.0264.76
4.3.110.0050.0204.67
4.3.100.0050.0154.66
4.3.90.0040.0234.63
4.3.80.0040.0294.58
4.3.70.0030.0164.63
4.3.60.0010.0164.63
4.3.50.0030.0154.63
4.3.40.0020.0244.54
4.3.30.0030.0183.30
4.3.20.0020.0263.28
4.3.10.0030.0213.23
4.3.00.0000.01715.63

preferences:
34.25 ms | 401 KiB | 5 Q