3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Shiterator implements SeekableIterator, Iterator { private $_array = array(); private $position; public function __construct(array $array) { $this->_array = $array; } public function seek($position) { if (!isset($this->_array[$position])) { throw new OutOfBoundsException("invalid seek position ($position)"); } $this->position = $position; } public function rewind() { $this->position = 0; } public function current() { return $this->array[$this->position]; } public function key() { return $this->position; } public function next() { ++$this->position; } public function valid() { return isset($this->array[$this->position]); } } $stdcls = new stdClass(); $stdcls->message = 'PHP, still a peice of shit.'; $i = new Shiterator(array($stdcls)); foreach ($i as $t) { echo $stdcls->message; $stdcls->message = 'Zend still produces garbage.'; } var_dump($i);

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.0000.01416.63
8.3.50.0090.00722.05
8.3.40.0040.01119.02
8.3.30.0040.01119.01
8.3.20.0080.00020.20
8.3.10.0070.00723.69
8.3.00.0070.00319.51
8.2.180.0110.00716.88
8.2.170.0140.00322.96
8.2.160.0130.00720.35
8.2.150.0160.00024.18
8.2.140.0050.00324.66
8.2.130.0090.00026.16
8.2.120.0000.00822.21
8.2.110.0030.00622.15
8.2.100.0060.00617.93
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0000.00919.91
8.2.30.0000.00918.09
8.2.20.0030.00617.66
8.2.10.0050.00218.09
8.2.00.0040.00417.85
8.1.280.0000.01825.92
8.1.270.0030.00623.79
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0120.00623.79
8.1.230.0040.00819.20
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0090.00017.36
8.1.190.0040.00417.35
8.1.180.0030.00619.01
8.1.170.0000.00818.49
8.1.160.0030.00521.96
8.1.150.0040.00418.70
8.1.140.0000.00717.47
8.1.130.0030.00317.74
8.1.120.0000.00717.52
8.1.110.0040.00417.51
8.1.100.0000.00717.47
8.1.90.0030.00417.42
8.1.80.0000.00817.46
8.1.70.0070.00017.40
8.1.60.0060.00317.55
8.1.50.0060.00317.53
8.1.40.0050.00217.52
8.1.30.0050.00317.49
8.1.20.0070.00017.57
8.1.10.0050.00317.59
8.1.00.0000.00817.37
8.0.300.0040.00418.77
8.0.290.0050.00217.04
8.0.280.0000.00718.50
8.0.270.0000.00717.34
8.0.260.0070.00017.23
8.0.250.0060.00016.84
8.0.240.0000.00816.96
8.0.230.0000.00716.95
8.0.220.0030.00316.77
8.0.210.0000.00716.98
8.0.200.0000.00816.85
8.0.190.0040.00416.92
8.0.180.0070.00016.91
8.0.170.0060.00316.85
8.0.160.0030.00616.86
8.0.150.0040.00416.83
8.0.140.0000.00816.86
8.0.130.0000.00613.36
8.0.120.0030.00516.79
8.0.110.0030.00516.84
8.0.100.0040.00416.68
8.0.90.0030.00516.85
8.0.80.0090.01216.96
8.0.70.0070.00016.93
8.0.60.0030.00516.90
8.0.50.0040.00416.78
8.0.30.0120.00716.98
8.0.20.0120.01017.40
8.0.10.0040.00416.89
8.0.00.0130.00816.75
7.4.330.0050.00015.15
7.4.320.0060.00016.61
7.4.300.0030.00316.60
7.4.290.0030.00316.42
7.4.280.0000.00816.50
7.4.270.0040.00416.52
7.4.260.0030.00316.50
7.4.250.0040.00416.58
7.4.240.0010.00616.56
7.4.230.0000.00716.42
7.4.220.0090.00916.64
7.4.210.0100.00716.54
7.4.200.0030.00316.49
7.4.190.0070.00016.70
7.4.160.0160.00016.47
7.4.150.0140.00317.40
7.4.140.0100.01017.86
7.4.130.0100.00816.37
7.4.120.0080.01116.51
7.4.110.0170.00716.66
7.4.100.0120.00916.36
7.4.90.0030.01516.64
7.4.80.0140.00319.39
7.4.70.0070.01016.48
7.4.60.0120.00516.31
7.4.50.0030.00316.23
7.4.40.0000.01716.57
7.4.30.0140.00316.44
7.4.00.0070.00714.86
7.3.330.0020.00213.19
7.3.320.0000.00513.31
7.3.310.0040.00416.01
7.3.300.0060.00316.10
7.3.290.0090.01016.20
7.3.280.0130.00416.24
7.3.270.0140.01117.40
7.3.260.0060.01916.34
7.3.250.0090.00816.34
7.3.240.0180.00316.30
7.3.230.0030.01216.45
7.3.210.0030.01416.35
7.3.200.0130.00819.39
7.3.190.0070.01116.40
7.3.180.0150.00716.29
7.3.170.0080.00816.36
7.3.160.0080.00816.38
7.3.120.0000.01314.68
7.3.10.0000.01516.39
7.3.00.0040.00916.46
7.2.330.0200.01716.54
7.2.320.0120.00616.28
7.2.310.0090.01016.51
7.2.300.0070.01016.48
7.2.290.0180.00616.38
7.2.130.0030.01316.78
7.2.120.0040.01116.91
7.2.110.0000.01216.73
7.2.100.0070.00716.58
7.2.90.0030.00716.94
7.2.80.0040.00716.65
7.2.70.0000.01516.85
7.2.60.0050.00516.63
7.2.50.0120.00016.38
7.2.40.0080.00416.85
7.2.30.0060.00916.43
7.2.20.0070.00416.86
7.2.10.0030.00616.66
7.2.00.0060.00617.97
7.1.250.0030.00615.83
7.1.100.0080.00417.98
7.1.70.0060.00916.86
7.1.60.0130.01319.46
7.1.50.0140.00416.54
7.1.00.0070.07722.57
7.0.200.0000.00716.69
7.0.140.0100.06721.97
7.0.60.0070.08020.02
7.0.50.0030.08317.89
7.0.40.0070.08020.13
7.0.30.0270.04720.26
7.0.20.0170.06320.09
7.0.10.0030.08020.08
7.0.00.0070.07720.07
5.6.280.0070.07021.11
5.6.210.0070.04320.57
5.6.200.0000.05018.18
5.6.190.0000.04720.61
5.6.180.0100.08320.48
5.6.170.0300.05320.46
5.6.160.0000.09320.57
5.6.150.0070.07718.27
5.6.140.0070.04018.19
5.6.130.0100.08318.23
5.6.120.0170.08020.98
5.6.110.0170.06721.13
5.6.100.0030.05721.12
5.6.90.0130.08020.96
5.6.80.0000.07720.52
5.5.350.0030.07020.41
5.5.340.0100.06718.02
5.5.330.0070.06720.47
5.5.320.0270.07720.35
5.5.310.0130.04020.27
5.5.300.0070.04017.98
5.5.290.0130.07718.08
5.5.280.0030.05720.97
5.5.270.0030.04020.88
5.5.260.0000.05720.96
5.5.250.0070.08320.57
5.5.240.0130.06720.14
5.4.450.0830.03719.46
5.4.440.0430.04719.32
5.4.430.0370.04719.19
5.4.420.0600.03019.19
5.4.410.0130.04019.14
5.4.400.0300.03719.32
5.4.390.0130.04018.98
5.4.380.0530.05018.76
5.4.370.0530.06318.79
5.4.360.0930.05718.64
5.4.350.0270.06318.64
5.4.340.0330.06318.59
5.4.320.0030.03912.51
5.4.310.0100.03512.50
5.4.300.0070.03612.51
5.4.290.0070.04412.50
5.4.280.0080.03812.40
5.4.270.0060.04212.40
5.4.260.0110.03712.41
5.4.250.0050.04212.40
5.4.240.0080.03512.40
5.4.230.0070.03812.39
5.4.220.0070.03712.39
5.4.210.0080.03812.39
5.4.200.0080.04112.39
5.4.190.0020.04412.39
5.4.180.0070.04712.39
5.4.170.0120.04512.40
5.4.160.0060.04212.40
5.4.150.0070.04012.39
5.4.140.0040.04312.08
5.4.130.0050.04312.07
5.4.120.0110.04712.02
5.4.110.0120.05012.02
5.4.100.0090.04612.02
5.4.90.0080.05312.02
5.4.80.0060.04612.02
5.4.70.0080.04412.01
5.4.60.0080.05712.01
5.4.50.0120.05312.02
5.4.40.0100.05212.00
5.4.30.0070.05412.00
5.4.20.0100.05312.00
5.4.10.0120.06012.00
5.4.00.0100.04411.49
5.3.290.0070.04012.80
5.3.280.0060.05212.71
5.3.270.0110.04912.72
5.3.260.0070.05512.72
5.3.250.0110.04712.72
5.3.240.0090.05012.72
5.3.230.0080.05512.71
5.3.220.0070.05112.68
5.3.210.0070.05412.68
5.3.200.0120.04812.68
5.3.190.0110.04712.68
5.3.180.0110.04912.67
5.3.170.0060.05112.67
5.3.160.0110.04712.68
5.3.150.0100.04912.67
5.3.140.0120.04612.66
5.3.130.0090.05312.66
5.3.120.0100.05312.66
5.3.110.0090.05012.66
5.3.100.0100.04612.13
5.3.90.0070.05012.11
5.3.80.0160.03612.11
5.3.70.0090.04512.11
5.3.60.0070.04512.09
5.3.50.0050.04912.04
5.3.40.0090.04912.04
5.3.30.0110.04412.02
5.3.20.0090.04411.78
5.3.10.0060.04911.74
5.3.00.0090.04811.73
5.2.170.0080.0399.23
5.2.160.0090.0379.23
5.2.150.0070.0409.23
5.2.140.0070.0409.23
5.2.130.0050.0409.20
5.2.120.0040.0399.19
5.2.110.0090.0359.20
5.2.100.0040.0409.20
5.2.90.0060.0399.20
5.2.80.0100.0379.20
5.2.70.0040.0429.19
5.2.60.0070.0419.14
5.2.50.0050.0439.12
5.2.40.0070.0369.09
5.2.30.0110.0349.07
5.2.20.0080.0359.05
5.2.10.0080.0338.96
5.2.00.0050.0378.82
5.1.60.0080.0288.10
5.1.50.0070.0298.09
5.1.40.0080.0338.08
5.1.30.0090.0338.43
5.1.20.0070.0358.45
5.1.10.0040.0348.17
5.1.00.0060.0338.18
5.0.50.0050.0256.65
5.0.40.0050.0246.51
5.0.30.0100.0336.31
5.0.20.0040.0246.28
5.0.10.0050.0246.27
5.0.00.0050.0356.26
4.4.90.0070.0164.78
4.4.80.0040.0214.75
4.4.70.0040.0204.75
4.4.60.0030.0164.75
4.4.50.0030.0154.77
4.4.40.0010.0284.70
4.4.30.0030.0174.75
4.4.20.0040.0164.85
4.4.10.0030.0174.85
4.4.00.0010.0274.76
4.3.110.0020.0184.67
4.3.100.0060.0144.66
4.3.90.0050.0144.63
4.3.80.0040.0304.58
4.3.70.0050.0184.63
4.3.60.0060.0174.63
4.3.50.0030.0194.63
4.3.40.0030.0264.54
4.3.30.0030.0173.30
4.3.20.0030.0193.28
4.3.10.0050.0183.23
4.3.00.0200.01716.04

preferences:
38.21 ms | 400 KiB | 5 Q