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; count($it);

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.0140.00718.30
8.3.50.0120.00618.18
8.3.40.0080.00818.75
8.3.30.0070.01418.88
8.3.20.0000.00820.34
8.3.10.0040.00423.65
8.3.00.0080.00019.38
8.2.180.0090.00918.54
8.2.170.0040.01122.96
8.2.160.0030.01020.39
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00317.75
8.2.120.0040.00426.35
8.2.110.0090.00022.06
8.2.100.0120.00019.89
8.2.90.0000.00819.23
8.2.80.0090.00017.97
8.2.70.0040.00417.63
8.2.60.0080.00018.04
8.2.50.0040.00418.07
8.2.40.0040.00419.38
8.2.30.0000.00820.70
8.2.20.0080.00017.80
8.2.10.0000.00817.95
8.2.00.0080.00018.07
8.1.280.0100.00625.92
8.1.270.0060.00323.86
8.1.260.0070.00028.09
8.1.250.0060.01028.09
8.1.240.0000.00923.91
8.1.230.0110.00018.94
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00917.35
8.1.180.0000.00818.10
8.1.170.0080.00018.46
8.1.160.0000.00721.95
8.1.150.0080.00018.90
8.1.140.0040.00419.59
8.1.130.0000.00717.70
8.1.120.0070.00017.34
8.1.110.0020.00517.52
8.1.100.0040.00417.49
8.1.90.0040.00417.51
8.1.80.0050.00317.40
8.1.70.0040.00417.51
8.1.60.0030.00617.48
8.1.50.0000.00817.50
8.1.40.0030.00617.55
8.1.30.0050.00317.54
8.1.20.0000.00717.46
8.1.10.0000.00717.55
8.1.00.0040.00417.51
8.0.300.0080.00018.77
8.0.290.0080.00016.75
8.0.280.0030.00318.47
8.0.270.0000.00717.32
8.0.260.0000.00617.32
8.0.250.0030.00316.93
8.0.240.0030.00517.01
8.0.230.0000.00716.96
8.0.220.0030.00316.93
8.0.210.0030.00316.98
8.0.200.0000.00816.90
8.0.190.0000.00917.07
8.0.180.0030.00516.98
8.0.170.0050.00216.93
8.0.160.0040.00416.88
8.0.150.0080.00016.86
8.0.140.0040.00816.95
8.0.130.0060.00013.43
8.0.120.0080.00016.95
8.0.110.0040.00417.00
8.0.100.0000.00816.99
8.0.90.0040.00416.86
8.0.80.0000.01716.92
8.0.70.0040.00416.97
8.0.60.0080.00016.93
8.0.50.0000.00717.01
8.0.30.0130.00617.28
8.0.20.0110.00817.40
8.0.10.0050.00317.15
8.0.00.0070.01016.85
7.4.330.0050.00016.83
7.4.320.0000.00716.53
7.4.300.0000.00716.59
7.4.290.0030.00316.60
7.4.280.0040.00416.60
7.4.270.0030.00316.51
7.4.260.0030.00316.60
7.4.250.0000.00716.50
7.4.240.0040.00316.64
7.4.230.0030.00316.64
7.4.220.0090.00916.61
7.4.210.0070.01316.55
7.4.200.0000.00716.50
7.4.160.0110.00416.62
7.4.150.0030.01317.40
7.4.140.0060.01217.86
7.4.130.0150.01516.59
7.4.120.0080.01016.63
7.4.110.0180.00316.48
7.4.100.0120.01216.50
7.4.90.0150.00916.67
7.4.80.0060.01219.39
7.4.70.0080.00816.45
7.4.60.0100.00716.43
7.4.50.0000.01416.61
7.4.40.0120.00316.55
7.4.30.0110.00616.68
7.4.10.0100.00714.91
7.4.00.0050.01015.03
7.3.330.0000.00713.24
7.3.320.0030.00313.32
7.3.310.0040.00416.39
7.3.300.0060.00016.38
7.3.290.0060.00916.36
7.3.280.0070.00916.38
7.3.270.0030.01417.40
7.3.260.0070.01016.30
7.3.250.0100.00916.40
7.3.240.0140.00316.41
7.3.230.0110.00616.39
7.3.210.0060.01016.43
7.3.200.0070.01416.30
7.3.190.0130.00316.32
7.3.180.0030.01316.41
7.3.170.0130.00916.41
7.3.160.0090.00616.32
7.3.130.0060.00914.74
7.3.120.0090.00914.67
7.3.110.0030.01415.09
7.3.100.0000.01215.02
7.3.90.0030.01314.62
7.3.80.0030.01615.00
7.3.70.0090.00614.59
7.3.60.0000.01714.86
7.3.50.0060.00614.95
7.3.40.0040.00714.79
7.3.30.0090.00314.76
7.3.20.0070.00716.75
7.3.10.0030.00716.50
7.3.00.0030.00716.61
7.2.330.0090.00916.66
7.2.320.0120.00416.80
7.2.310.0100.01016.54
7.2.300.0110.00616.75
7.2.290.0120.00916.79
7.2.260.0000.01715.27
7.2.250.0070.01115.03
7.2.240.0110.00314.79
7.2.230.0120.00014.98
7.2.220.0070.01015.13
7.2.210.0060.00614.94
7.2.200.0070.00714.96
7.2.190.0050.00515.05
7.2.180.0040.01214.89
7.2.170.0040.01114.71
7.2.160.0130.00314.97
7.2.150.0030.01216.90
7.2.140.0000.01417.07
7.2.130.0090.00316.90
7.2.120.0090.00316.89
7.2.110.0030.01216.93
7.2.100.0070.01016.72
7.2.90.0000.01016.92
7.2.80.0040.01216.97
7.2.70.0080.00816.95
7.2.60.0050.00916.78
7.2.50.0070.00317.13
7.2.40.0110.00416.86
7.2.30.0060.01016.93
7.2.20.0070.00716.68
7.2.10.0060.00916.59
7.2.00.0070.00818.27
7.1.330.0040.01115.73
7.1.320.0030.00915.75
7.1.310.0000.01115.65
7.1.300.0040.00815.54
7.1.290.0000.01515.76
7.1.280.0070.00415.81
7.1.270.0030.01015.75
7.1.260.0030.01015.95
7.1.250.0000.01615.63
7.1.240.0040.01115.80
7.1.230.0060.00615.72
7.1.220.0000.01115.62
7.1.210.0070.01015.57
7.1.200.0000.01215.63
7.1.190.0060.00615.62
7.1.180.0000.01215.69
7.1.170.0060.00615.77
7.1.160.0110.00415.92
7.1.150.0000.01015.88
7.1.140.0040.00715.43
7.1.130.0030.00615.73
7.1.120.0050.00515.72
7.1.110.0000.01315.84
7.1.100.0040.00716.92
7.1.90.0000.01715.85
7.1.80.0000.01515.90
7.1.70.0020.01016.26
7.1.60.0100.00317.67
7.1.50.0090.01016.50
7.1.40.0100.00315.47
7.1.30.0000.01515.83
7.1.20.0080.00415.81
7.1.10.0000.01015.77
7.1.00.0100.03519.04
7.0.330.0110.00415.40
7.0.320.0090.00315.29
7.0.310.0000.01315.30
7.0.300.0060.00315.36
7.0.290.0070.00715.43
7.0.280.0000.00915.13
7.0.270.0110.00015.38
7.0.260.0060.00615.30
7.0.250.0030.01215.21
7.0.240.0060.00615.50
7.0.230.0000.00815.62
7.0.220.0080.00015.56
7.0.210.0070.00715.38
7.0.200.0020.00816.13
7.0.190.0040.01115.13
7.0.180.0050.00315.54
7.0.170.0100.00315.45
7.0.160.0130.00315.25
7.0.150.0100.00015.30
7.0.140.0040.00715.37
7.0.130.0070.01115.28
7.0.120.0070.01015.28
7.0.110.0060.01015.45
7.0.100.0040.01215.19
7.0.90.0030.00615.39
7.0.80.0000.01115.41
7.0.70.0100.00315.63
7.0.60.0120.03718.48
7.0.50.0060.03416.60
7.0.40.0080.03816.92
7.0.30.0130.03116.83
7.0.20.0150.03816.74
7.0.10.0100.04016.78
7.0.00.0060.04316.83
5.6.400.0060.00614.55
5.6.390.0130.00014.58
5.6.380.0060.00913.94
5.6.370.0000.01214.21
5.6.360.0060.00914.38
5.6.350.0000.01514.42
5.6.340.0030.01014.68
5.6.330.0070.00714.44
5.6.320.0080.00814.76
5.6.310.0030.01014.41
5.6.300.0060.00914.59
5.6.290.0060.01014.41
5.6.280.0050.03717.77
5.6.270.0030.01314.53
5.6.260.0070.00414.46
5.6.250.0110.00414.59
5.6.240.0080.00414.29
5.6.230.0060.00914.48
5.6.220.0070.00714.22
5.6.210.0040.04717.55
5.6.200.0020.02416.39
5.6.190.0120.03317.64
5.6.180.0200.02117.37
5.6.170.0150.02517.55
5.6.160.0140.03017.35
5.6.150.0130.02816.38
5.6.140.0070.04016.31
5.6.130.0080.04116.27
5.6.120.0080.04517.71
5.6.110.0070.03917.76
5.6.100.0030.02717.54
5.6.90.0080.02317.49
5.6.80.0110.03017.33
5.6.70.0060.00614.09
5.6.60.0100.01014.52
5.6.50.0080.00814.32
5.6.40.0090.00914.05
5.6.30.0070.00714.38
5.6.20.0110.00014.51
5.6.10.0090.00614.28
5.6.00.0060.00614.29
5.5.380.0060.00814.18
5.5.370.0100.00714.50
5.5.360.0090.00314.37
5.5.350.0100.04517.42
5.5.340.0080.02516.24
5.5.330.0030.02717.46
5.5.320.0330.03117.25
5.5.310.0170.04317.33
5.5.300.0050.03816.04
5.5.290.0080.04016.09
5.5.280.0100.04217.56
5.5.270.0100.04217.56
5.5.260.0080.04417.39
5.5.250.0040.04517.59
5.5.240.0120.03917.18
5.5.230.0070.00714.30
5.5.220.0100.01013.85
5.5.210.0030.01014.46
5.5.200.0110.00814.39
5.5.190.0070.00714.42
5.5.180.0080.00613.98
5.5.170.0000.01414.34
5.5.160.0090.00614.31
5.5.150.0030.00914.18
5.5.140.0030.00914.32
5.5.130.0120.00314.09
5.5.120.0060.00614.39
5.5.110.0030.00714.24
5.5.100.0040.00414.12
5.5.90.0070.00714.09
5.5.80.0060.00614.02
5.5.70.0030.01014.07
5.5.60.0070.00714.27
5.5.50.0030.01013.98
5.5.40.0030.01014.36
5.5.30.0040.01114.39
5.5.20.0060.00914.35
5.5.10.0070.00714.50
5.5.00.0060.00914.45

preferences:
52.51 ms | 401 KiB | 5 Q