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 $value) { var_dump($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.0090.00616.88
8.3.50.0230.00322.80
8.3.40.0120.00318.67
8.3.30.0090.00619.02
8.3.20.0080.00020.21
8.3.10.0050.00223.79
8.3.00.0060.00319.50
8.2.180.0120.00318.29
8.2.170.0120.00322.96
8.2.160.0130.00020.38
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.01326.16
8.2.120.0070.00021.01
8.2.110.0060.00319.21
8.2.100.0120.00017.78
8.2.90.0060.00317.91
8.2.80.0050.00318.34
8.2.70.0030.00617.75
8.2.60.0100.00017.75
8.2.50.0030.00617.55
8.2.40.0070.00319.95
8.2.30.0000.00718.14
8.2.20.0000.00817.67
8.2.10.0040.00418.23
8.2.00.0000.00717.80
8.1.280.0070.00725.92
8.1.270.0080.00023.67
8.1.260.0000.00726.35
8.1.250.0190.00028.09
8.1.240.0070.00322.49
8.1.230.0080.00321.04
8.1.220.0060.00317.78
8.1.210.0040.00419.03
8.1.200.0080.00017.23
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0000.00818.64
8.1.160.0000.00722.07
8.1.150.0000.00718.91
8.1.140.0020.00517.43
8.1.130.0070.00017.84
8.1.120.0000.00817.49
8.1.110.0030.00517.44
8.1.100.0070.00317.38
8.1.90.0070.00017.45
8.1.80.0100.00017.51
8.1.70.0030.00317.47
8.1.60.0060.00317.59
8.1.50.0040.00417.48
8.1.40.0040.00717.52
8.1.30.0040.00417.70
8.1.20.0030.00517.66
8.1.10.0050.00317.54
8.1.00.0000.00817.40
8.0.300.0030.00519.86
8.0.290.0050.00316.75
8.0.280.0040.00418.38
8.0.270.0030.00317.33
8.0.260.0060.00017.21
8.0.250.0070.00016.99
8.0.240.0080.00016.88
8.0.230.0030.00316.84
8.0.220.0030.00316.82
8.0.210.0080.00016.86
8.0.200.0000.00716.83
8.0.190.0030.00616.97
8.0.180.0080.00016.89
8.0.170.0000.00816.95
8.0.160.0000.00816.98
8.0.150.0000.00716.80
8.0.140.0040.00416.75
8.0.130.0030.00313.33
8.0.120.0030.00616.84
8.0.110.0040.00416.77
8.0.100.0000.00816.84
8.0.90.0000.00716.73
8.0.80.0100.00716.78
8.0.70.0040.00416.97
8.0.60.0000.00717.02
8.0.50.0000.00816.91
8.0.30.0130.00717.12
8.0.20.0050.01317.40
8.0.10.0050.00317.04
8.0.00.0030.01716.69
7.4.330.0000.00515.08
7.4.320.0000.00716.57
7.4.300.0030.00316.65
7.4.290.0000.00716.51
7.4.280.0000.00816.65
7.4.270.0030.00316.61
7.4.260.0030.00516.56
7.4.250.0040.00416.57
7.4.240.0030.00516.60
7.4.230.0000.00716.71
7.4.220.0140.00316.46
7.4.210.0090.00616.65
7.4.200.0040.00416.54
7.4.160.0070.01116.48
7.4.150.0040.01417.40
7.4.140.0080.01017.86
7.4.130.0130.00416.46
7.4.120.0070.01016.53
7.4.110.0030.01416.55
7.4.100.0120.00616.46
7.4.90.0070.01116.43
7.4.80.0110.01119.39
7.4.70.0030.01416.42
7.4.60.0090.01316.48
7.4.50.0000.00516.34
7.4.40.0130.00316.56
7.4.30.0070.01116.39
7.4.00.0090.00915.16
7.3.330.0030.00313.23
7.3.320.0050.00013.19
7.3.310.0040.00416.41
7.3.300.0070.00016.32
7.3.290.0090.00916.36
7.3.280.0040.01116.36
7.3.270.0120.00617.40
7.3.260.0070.01816.39
7.3.250.0120.00716.54
7.3.240.0110.01116.68
7.3.230.0150.00616.40
7.3.210.0060.01216.32
7.3.200.0090.00919.39
7.3.190.0060.01216.53
7.3.180.0130.00316.57
7.3.170.0040.01216.45
7.3.160.0100.00716.63
7.3.10.0070.00716.71
7.3.00.0060.00916.71
7.2.330.0070.01116.74
7.2.320.0060.01016.84
7.2.310.0090.00616.43
7.2.300.0080.00816.64
7.2.290.0160.00416.85
7.2.130.0070.01017.03
7.2.120.0100.00716.73
7.2.110.0080.00816.74
7.2.100.0050.00516.73
7.2.90.0100.00716.71
7.2.80.0090.00616.75
7.2.70.0060.00316.82
7.2.60.0120.00416.90
7.2.50.0040.01217.02
7.2.40.0060.00617.13
7.2.30.0080.00617.04
7.2.20.0000.01116.96
7.2.10.0030.01317.13
7.2.00.0100.00318.21
7.1.250.0080.00015.80
7.1.100.0000.01117.94
7.1.70.0050.00317.09
7.1.60.0040.01117.29
7.1.50.0070.01416.65
7.1.00.0070.07322.30
7.0.200.0040.01216.88
7.0.140.0100.06722.04
7.0.60.0070.05719.93
7.0.50.0070.03717.86
7.0.40.0070.09020.25
7.0.30.0330.08720.33
7.0.20.0300.06720.27
7.0.10.0100.04720.07
7.0.00.0000.04720.36
5.6.280.0030.07021.08
5.6.210.0030.07720.58
5.6.200.0030.04718.18
5.6.190.0070.05720.33
5.6.180.0270.07320.63
5.6.170.0270.05320.45
5.6.160.0100.05020.44
5.6.150.0000.09018.23
5.6.140.0070.03318.18
5.6.130.0000.04718.18
5.6.120.0070.08320.97
5.6.110.0000.08321.00
5.6.100.0030.04321.11
5.6.90.0030.05720.98
5.6.80.0070.04720.54
5.6.70.4600.03720.38
5.5.350.0000.07020.41
5.5.340.0000.05717.99
5.5.330.0070.04020.47
5.5.320.0270.06320.36
5.5.310.0200.06020.34
5.5.300.0030.04017.98
5.5.290.0170.06318.02
5.5.280.0130.07320.86
5.5.270.0100.07320.98
5.5.260.0070.07020.78
5.5.250.0070.08720.44
5.5.240.0230.04720.17
5.4.450.0270.05019.45
5.4.440.0870.05319.59
5.4.430.0200.05019.48
5.4.420.0200.05019.61
5.4.410.0300.04719.40
5.4.400.0400.06319.16
5.4.390.0330.04019.14
5.4.380.0800.05318.69
5.4.370.0900.04718.72
5.4.360.1100.05018.61
5.4.350.0900.05318.61
5.4.340.0670.05718.57
5.4.320.0030.04012.50
5.4.310.0060.03812.50
5.4.300.0040.03912.51
5.4.290.0050.03912.51
5.4.280.0100.03112.40
5.4.270.0040.03812.41
5.4.260.0110.03212.40
5.4.250.0090.03512.40
5.4.240.0070.03512.40
5.4.230.0050.03912.39
5.4.220.0070.03612.39
5.4.210.0040.03812.39
5.4.200.0050.03812.40
5.4.190.0080.03412.39
5.4.180.0070.03612.39
5.4.170.0070.03612.41
5.4.160.0080.03912.40
5.4.150.0070.04212.39
5.4.140.0090.03812.07
5.4.130.0040.04512.07
5.4.120.0070.03512.02
5.4.110.0060.03412.02
5.4.100.0070.04512.02
5.4.90.0080.03912.02
5.4.80.0010.04112.02
5.4.70.0070.04312.02
5.4.60.0100.04012.02
5.4.50.0060.04112.02
5.4.40.0060.03812.00
5.4.30.0060.03812.00
5.4.20.0080.04112.00
5.4.10.0070.03512.00
5.4.00.0050.03611.49
5.3.290.0060.03812.80
5.3.280.0040.03812.71
5.3.270.0110.04412.72
5.3.260.0090.04812.72
5.3.250.0070.04012.72
5.3.240.0060.04612.72
5.3.230.0130.03512.71
5.3.220.0040.04112.68
5.3.210.0040.04812.68
5.3.200.0100.04712.68
5.3.190.0060.03812.68
5.3.180.0100.03112.68
5.3.170.0050.03712.67
5.3.160.0040.03712.67
5.3.150.0090.04112.68
5.3.140.0050.03712.66
5.3.130.0060.03812.65
5.3.120.0080.03512.65
5.3.110.0070.03712.66
5.3.100.0060.03712.13
5.3.90.0110.03512.11
5.3.80.0080.03812.10
5.3.70.0070.03512.11
5.3.60.0020.04012.09
5.3.50.0060.03512.03
5.3.40.0070.03312.03
5.3.30.0110.03411.99
5.3.20.0060.03911.77
5.3.10.0050.03911.74
5.3.00.0050.04011.73
5.2.170.0030.0429.22
5.2.160.0050.0299.23
5.2.150.0060.0299.23
5.2.140.0050.0309.22
5.2.130.0050.0289.18
5.2.120.0050.0279.19
5.2.110.0050.0289.20
5.2.100.0070.0269.19
5.2.90.0020.0319.19
5.2.80.0080.0349.18
5.2.70.0070.0319.18
5.2.60.0050.0339.14
5.2.50.0050.0299.11
5.2.40.0030.0299.08
5.2.30.0050.0359.06
5.2.20.0050.0279.04
5.2.10.0040.0278.95
5.2.00.0030.0308.81
5.1.60.0030.0258.10
5.1.50.0090.0318.09
5.1.40.0050.0368.07
5.1.30.0040.0348.43
5.1.20.0060.0358.45
5.1.10.0040.0328.18
5.1.00.0030.0278.17
5.0.50.0020.0216.65
5.0.40.0020.0206.51
5.0.30.0040.0316.33
5.0.20.0040.0186.29
5.0.10.0060.0216.27
5.0.00.0060.0356.27
4.4.90.0040.0144.78
4.4.80.0030.0154.75
4.4.70.0020.0154.76
4.4.60.0040.0134.76
4.4.50.0010.0274.77
4.4.40.0000.0274.71
4.4.30.0000.0284.76
4.4.20.0020.0164.84
4.4.10.0020.0164.85
4.4.00.0010.0254.76
4.3.110.0030.0164.67
4.3.100.0020.0154.66
4.3.90.0010.0154.63
4.3.80.0030.0314.59
4.3.70.0020.0154.63
4.3.60.0010.0164.63
4.3.50.0070.0154.63
4.3.40.0030.0224.54
4.3.30.0010.0253.30
4.3.20.0030.0143.28
4.3.10.0030.0143.23
4.3.00.0070.01015.63

preferences:
51.37 ms | 401 KiB | 5 Q