3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CSVFileIterator implements Iterator{ protected $_index = 0; function __construct() { } /** * (PHP 5 >= 5.0.0)<br/> * Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ public function current() { return $this->_index; } /** * (PHP 5 >= 5.0.0)<br/> * Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next() { var_dump('next'); $this->_index++; } /** * (PHP 5 >= 5.0.0)<br/> * Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ public function key() { var_dump('key'); return $this->_index; } /** * (PHP 5 >= 5.0.0)<br/> * Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return boolean The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid() { var_dump('valid'); return $this->_index <5; } /** * (PHP 5 >= 5.0.0)<br/> * Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind() { var_dump('rewind'); $this->_index = 0; } } $i = new CSVFileIterator(); foreach ($i as $j);

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.40.0170.00318.81
8.3.30.0060.00919.03
8.3.20.0080.00020.18
8.3.10.0050.00323.60
8.3.00.0030.00817.50
8.2.170.0140.00722.96
8.2.160.0100.00320.52
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0030.00626.16
8.2.120.0060.00322.08
8.2.110.0030.00622.16
8.2.100.0060.00617.91
8.2.90.0000.00819.21
8.2.80.0060.00317.97
8.2.70.0000.00817.48
8.2.60.0040.00418.03
8.2.50.0000.00818.07
8.2.40.0000.00818.22
8.2.30.0000.00718.09
8.2.20.0050.00317.83
8.2.10.0050.00317.78
8.2.00.0070.00017.68
8.1.270.0090.00022.19
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0040.00423.84
8.1.230.0040.00719.02
8.1.220.0000.00817.79
8.1.210.0000.00918.77
8.1.200.0000.00917.35
8.1.190.0040.00417.66
8.1.180.0000.00818.10
8.1.170.0070.00318.68
8.1.160.0070.00022.05
8.1.150.0040.00418.60
8.1.140.0040.00417.48
8.1.130.0030.00317.73
8.1.120.0070.00017.46
8.1.110.0040.00417.52
8.1.100.0040.00417.48
8.1.90.0000.00717.39
8.1.80.0060.00317.45
8.1.70.0070.00017.34
8.1.60.0020.00517.50
8.1.50.0040.00417.55
8.1.40.0060.00317.58
8.1.30.0000.00817.61
8.1.20.0030.00517.70
8.1.10.0000.00717.55
8.1.00.0030.00617.50
8.0.300.0040.00418.77
8.0.290.0070.00017.18
8.0.280.0050.00218.47
8.0.270.0040.00417.21
8.0.260.0050.00316.92
8.0.250.0030.00316.93
8.0.240.0080.00017.04
8.0.230.0090.00016.98
8.0.220.0030.00316.93
8.0.210.0030.00316.83
8.0.200.0000.00716.96
8.0.190.0090.00017.00
8.0.180.0090.00016.96
8.0.170.0000.00816.86
8.0.160.0050.00316.85
8.0.150.0050.00316.93
8.0.140.0040.00416.80
8.0.130.0000.00613.31
8.0.120.0070.00016.93
8.0.110.0040.00416.83
8.0.100.0040.00416.79
8.0.90.0050.00316.77
8.0.80.0090.00616.86
8.0.70.0030.00516.79
8.0.60.0050.00216.75
8.0.50.0000.00716.93
8.0.30.0090.00916.96
8.0.20.0060.01217.40
8.0.10.0070.00017.00
8.0.00.0080.01316.60
7.4.330.0000.00515.00
7.4.320.0000.00616.67
7.4.300.0030.00316.62
7.4.290.0000.00716.55
7.4.280.0000.00716.48
7.4.270.0070.00016.59
7.4.260.0030.00316.57
7.4.250.0040.00416.51
7.4.240.0050.00216.61
7.4.230.0030.00316.38
7.4.220.0160.00316.39
7.4.210.0090.00716.68
7.4.200.0000.00816.37
7.4.190.0040.00416.49
7.4.160.0130.00316.51
7.4.150.0180.00017.40
7.4.140.0120.01017.86
7.4.130.0090.01216.53
7.4.120.0090.00816.56
7.4.110.0080.00816.45
7.4.100.0130.00716.42
7.4.90.0040.01416.64
7.4.80.0140.00419.39
7.4.70.0050.01816.63
7.4.60.0030.01316.46
7.4.50.0040.00016.55
7.4.40.0070.00522.77
7.4.30.0060.01116.45
7.4.00.0060.01015.00
7.3.330.0000.00513.26
7.3.320.0070.00013.14
7.3.310.0000.00716.30
7.3.300.0000.00616.30
7.3.290.0030.01216.27
7.3.280.0050.01316.26
7.3.270.0090.00917.40
7.3.260.0100.00616.71
7.3.250.0090.00916.52
7.3.240.0120.00416.39
7.3.230.0090.01516.39
7.3.210.0080.00816.35
7.3.200.0060.01519.39
7.3.190.0060.01416.39
7.3.180.0130.00316.29
7.3.170.0110.00416.49
7.3.160.0130.00316.58
7.3.120.0080.00614.79
7.3.110.0070.00715.00
7.3.100.0120.00314.79
7.3.90.0000.01314.89
7.3.80.0000.01614.65
7.3.70.0060.00314.60
7.3.60.0050.00514.81
7.3.50.0030.00614.66
7.3.40.0030.01114.71
7.3.30.0100.00614.92
7.3.20.0100.00316.50
7.3.10.0110.01116.77
7.3.00.0110.00716.57
7.2.330.0100.01016.83
7.2.320.0130.00416.77
7.2.310.0090.00916.53
7.2.300.0130.00516.83
7.2.290.0160.00516.70
7.2.250.0100.00715.16
7.2.240.0130.00714.87
7.2.230.0090.00615.00
7.2.220.0060.00615.28
7.2.210.0070.00715.16
7.2.200.0070.01014.82
7.2.190.0080.00815.20
7.2.180.0100.00314.91
7.2.170.0000.01415.01
7.2.130.0190.00416.69
7.2.120.0100.00616.81
7.2.110.0110.00816.64
7.2.100.0110.01116.56
7.2.90.0090.00916.77
7.2.80.0190.00016.66
7.2.70.0130.00916.84
7.2.60.0090.01516.74
7.2.50.0190.00516.79
7.2.40.0130.01116.95
7.2.30.0190.00816.72
7.2.20.0200.00916.73
7.2.10.0070.01016.67
7.2.00.0090.00618.11
7.1.330.0000.01415.67
7.1.320.0100.00015.93
7.1.310.0040.01215.72
7.1.300.0070.00315.39
7.1.290.0000.01215.82
7.1.280.0090.00315.98
7.1.270.0070.01015.92
7.1.260.0040.00715.82
7.1.250.0110.00615.23
7.1.100.0030.00818.27
7.1.70.0030.00617.01
7.1.60.0040.02219.31
7.1.50.0060.01916.73
7.1.00.0030.07322.35
7.0.200.0070.00716.88
7.0.140.0000.07022.00
7.0.60.0100.08020.04
7.0.50.0000.08717.90
7.0.40.0100.03720.40
7.0.30.0270.04720.28
7.0.20.0330.08020.05
7.0.10.0130.07320.06
7.0.00.0030.04720.16
5.6.280.0130.06321.05
5.6.210.0030.08320.71
5.6.200.0030.04318.16
5.6.190.0030.04320.50
5.6.180.0330.06320.64
5.6.170.0300.06320.47
5.6.160.0030.06320.48
5.6.150.0100.04318.29
5.6.140.0100.03718.21
5.6.130.0070.08018.14
5.6.120.0000.05721.02
5.6.110.0100.07720.99
5.6.100.0070.04721.11
5.6.90.0100.04021.13
5.6.80.0100.08020.47
5.6.70.4100.03720.53
5.5.350.0170.04020.45
5.5.340.0130.05318.10
5.5.330.0070.06720.23
5.5.320.0400.07020.50
5.5.310.0230.06020.41
5.5.300.0130.07018.04
5.5.290.0100.07317.94
5.5.280.0130.04020.88
5.5.270.0230.06720.87
5.5.260.0070.08320.88
5.5.250.0200.07320.66
5.5.240.0330.06720.24
5.4.450.0230.07319.39
5.4.440.0200.06019.60
5.4.430.0130.07019.47
5.4.420.0630.00019.54
5.4.410.0100.05718.97
5.4.400.0300.06018.85
5.4.390.0170.05318.56
5.4.380.0170.06018.61
5.4.370.0070.04018.70
5.4.360.0070.04018.73
5.4.350.0050.03812.03
5.4.340.0100.03312.02
5.4.320.0060.03912.50
5.4.310.0040.04212.50
5.4.300.0080.04112.51
5.4.290.0050.03912.50
5.4.280.0090.03512.40
5.4.270.0070.03512.40
5.4.260.0120.04212.39
5.4.250.0070.04612.40
5.4.240.0060.03712.39
5.4.230.0080.03812.39
5.4.220.0120.05012.39
5.4.210.0090.04412.39
5.4.200.0050.05512.39
5.4.190.0220.04512.36
5.4.180.0480.08012.36
5.4.170.0280.06612.38
5.4.160.0430.11312.38
5.4.150.0190.04712.37
5.4.140.0420.09712.05
5.4.130.0210.04512.04
5.4.120.0200.04411.99
5.4.110.0150.04911.99
5.4.100.0270.06811.99
5.4.90.0170.05111.99
5.4.80.0140.05111.99
5.4.70.0150.05011.99
5.4.60.0270.06511.99
5.4.50.0230.05011.99
5.4.40.0240.04411.98
5.4.30.0320.09411.98
5.4.20.0210.04611.97
5.4.10.0290.04711.98
5.4.00.0380.08911.46
5.3.290.0030.04412.80
5.3.280.0070.04112.71
5.3.270.0230.05112.72
5.3.260.0420.09012.72
5.3.250.0170.05312.72
5.3.240.0360.09312.72
5.3.230.0190.04912.70
5.3.220.0160.05212.68
5.3.210.0390.09212.68
5.3.200.0180.04712.68
5.3.190.0180.04912.68
5.3.180.0150.04912.68
5.3.170.0170.04612.67
5.3.160.0220.07112.68
5.3.150.0250.04212.68
5.3.140.0170.04912.66
5.3.130.0160.04912.66
5.3.120.0280.09812.66
5.3.110.0200.04612.66
5.3.100.0250.04512.12
5.3.90.0440.08112.09
5.3.80.0130.05012.08
5.3.70.0120.04912.07
5.3.60.0160.04512.07
5.3.50.0140.04612.01
5.3.40.0310.05812.00
5.3.30.0160.04211.97
5.3.20.0150.04811.75
5.3.10.0120.04511.72
5.3.00.0120.04511.70
5.2.170.0190.0599.20
5.2.160.0140.0339.21
5.2.150.0120.0359.21
5.2.140.0120.0369.21
5.2.130.0150.0329.16
5.2.120.0120.0369.16
5.2.110.0260.0849.17
5.2.100.0150.0349.17
5.2.90.0130.0359.17
5.2.80.0100.0389.16
5.2.70.0150.0349.16
5.2.60.0130.0649.12
5.2.50.0110.0379.08
5.2.40.0150.0349.06
5.2.30.0170.0329.03
5.2.20.0110.0389.04
5.2.10.0100.0398.93
5.2.00.0100.0358.79
5.1.60.0290.0488.07
5.1.50.0140.0288.07
5.1.40.0230.0848.05
5.1.30.0120.0358.41
5.1.20.0150.0368.43
5.1.10.0180.0308.15
5.1.00.0280.0778.15
5.0.50.0100.0296.63
5.0.40.0100.0226.48
5.0.30.0100.0396.30
5.0.20.0130.0226.28
5.0.10.0110.0216.25
5.0.00.0070.0376.24
4.4.90.0080.0194.77
4.4.80.0080.0174.76
4.4.70.0070.0194.76
4.4.60.0090.0174.75
4.4.50.0070.0204.77
4.4.40.0050.0314.70
4.4.30.0080.0184.76
4.4.20.0130.0114.85
4.4.10.0060.0184.85
4.4.00.0160.0804.76
4.3.110.0100.0154.67
4.3.100.0100.0154.67
4.3.90.0040.0224.63
4.3.80.0070.0284.58
4.3.70.0080.0174.63
4.3.60.0050.0194.63
4.3.50.0060.0194.63
4.3.40.0090.0254.54
4.3.30.0050.0183.30
4.3.20.0040.0193.28
4.3.10.0070.0153.24
4.3.00.0000.0276.15

preferences:
40.26 ms | 400 KiB | 5 Q