3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a implements \Iterator, \Countable { private $a; private $b; private $c; private $keys = [ 'a', 'b', 'c' ]; private $pointer; public function __construc($a = null, $b = null, $c = null) { $this->a = $a; $this->b = $b; $this->c = $c; } public function count() { $pointer = 0; foreach ($this as $element) { if ($element) { $pointer++; } } return $pointer; } public function current() { $key = $this->key(); return $this->{$key}; } public function key() { $this->keys[$this->pointer]; } public function next() { $this->pointer++; } public function valid() { return true; if (count($this->keys) < $this->pointer) { true; } return false; } public function rewind() { $this->pointer = 0; } } $me = new a('a'); var_dump($me->count()); foreach ($me as $key => $el) { var_dump($key, $el); }

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.0100.00716.63
8.3.50.0190.00921.20
8.3.40.0030.01318.80
8.3.30.0120.01218.71
8.3.20.0190.00621.95
8.3.10.0050.00923.65
8.3.00.0060.00319.79
8.2.180.0230.00816.88
8.2.170.0290.01422.96
8.2.160.0280.00620.50
8.2.150.0070.00324.18
8.2.140.0090.00024.66
8.2.130.0130.00026.16
8.2.120.0100.00017.59
8.2.110.0080.00820.46
8.2.100.0100.00717.84
8.2.90.0070.00319.17
8.2.80.0100.00317.97
8.2.70.0120.00017.62
8.2.60.0060.00317.93
8.2.50.0100.00018.07
8.2.40.0080.00419.38
8.2.30.0000.01118.15
8.2.20.0060.00318.00
8.2.10.0000.01018.21
8.2.00.0040.00418.20
8.1.280.0060.00925.92
8.1.270.0060.00320.27
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0040.01223.79
8.1.230.0000.01220.91
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0090.00317.38
8.1.180.0030.00618.10
8.1.170.0000.01118.50
8.1.160.0070.00422.09
8.1.150.0000.01118.82
8.1.140.0000.01017.62
8.1.130.0060.00317.84
8.1.120.0040.00417.59
8.1.110.0000.00917.60
8.1.100.0050.00517.60
8.1.90.0030.00617.45
8.1.80.0000.01117.58
8.1.70.0070.00017.43
8.1.60.0060.00317.56
8.1.50.0060.00317.45
8.1.40.0050.00517.55
8.1.30.0120.00017.71
8.1.20.0040.00817.65
8.1.10.0130.00017.71
8.1.00.0000.01117.57
8.0.300.0050.00518.77
8.0.290.0060.00316.63
8.0.280.0080.00418.38
8.0.270.0030.00617.23
8.0.260.0030.00717.16
8.0.250.0080.00316.98
8.0.240.0080.00617.03
8.0.230.0050.00316.88
8.0.220.0060.00316.97
8.0.210.0030.00616.82
8.0.200.0040.00416.99
8.0.190.0030.00916.80
8.0.180.0000.00816.96
8.0.170.0050.00516.92
8.0.160.0030.00517.00
8.0.150.0040.00416.86
8.0.140.0110.00416.84
8.0.130.0000.00813.42
8.0.120.0030.00616.96
8.0.110.0000.01116.78
8.0.100.0040.00816.82
8.0.90.0070.00016.79
8.0.80.0200.01216.81
8.0.70.0110.00016.84
8.0.60.0000.00816.73
8.0.50.0090.00016.86
8.0.30.0080.01317.04
8.0.20.0310.01117.40
8.0.10.0040.00417.05
8.0.00.0180.01616.69
7.4.330.0080.00015.08
7.4.320.0030.00316.42
7.4.300.0060.00316.55
7.4.290.0000.01116.37
7.4.280.0110.00016.32
7.4.270.0090.00016.42
7.4.260.0050.00516.46
7.4.250.0030.00616.29
7.4.240.0020.00716.47
7.4.230.0000.00716.61
7.4.220.0220.01716.44
7.4.210.0100.01016.48
7.4.200.0000.00816.61
7.4.160.0070.01716.55
7.4.150.0480.01717.40
7.4.140.0320.02017.86
7.4.130.0280.01116.50
7.4.120.0200.01516.44
7.4.110.0330.01916.55
7.4.100.0230.01916.54
7.4.90.0040.02316.55
7.4.80.0550.01719.39
7.4.70.0240.01316.63
7.4.60.0110.01516.51
7.4.50.0000.01316.21
7.4.40.0110.02916.60
7.4.30.0250.01316.41
7.4.00.0060.00914.72
7.3.330.0331.95213.45
7.3.320.0071.99413.48
7.3.310.0080.00016.31
7.3.300.0060.00316.38
7.3.290.0000.00816.27
7.3.280.0120.01516.31
7.3.270.0140.01717.40
7.3.260.0360.01616.31
7.3.250.0280.02016.33
7.3.240.0160.01616.34
7.3.230.0640.03116.51
7.3.210.0100.02316.29
7.3.200.0190.01916.63
7.3.190.0760.02316.40
7.3.180.0070.02916.64
7.3.170.0340.03116.27
7.3.160.0220.01516.48
7.2.330.0390.01816.83
7.2.320.0140.02116.62
7.2.310.0730.03616.68
7.2.300.0340.01916.80
7.2.290.0130.01016.63
7.2.80.0040.01216.43
7.2.60.0000.01516.88
7.2.00.0060.00819.20
7.1.200.0070.00716.01
7.1.100.0040.00717.91
7.1.70.0030.00716.61
7.1.60.0090.00620.03
7.1.50.0000.01117.14
7.1.00.0030.06322.31
7.0.200.0000.00716.78
7.0.60.0030.04719.88
7.0.50.0100.03717.84
7.0.40.0100.04319.96
7.0.30.0330.05320.19
7.0.20.0230.05020.09
7.0.10.0000.07720.26
7.0.00.0070.08320.23
5.6.280.0030.03321.03
5.6.210.0100.07320.72
5.6.200.0130.06318.21
5.6.190.0130.08020.61
5.6.180.4370.04020.55
5.6.170.0230.08320.39
5.6.160.0100.07720.47
5.6.150.0000.04718.18
5.6.140.0070.08018.14
5.6.130.0100.08318.18
5.6.120.0000.09020.95
5.6.110.0000.08321.02
5.6.100.0170.07721.12
5.6.90.0100.06021.04
5.6.80.0100.06720.39
5.6.70.3900.04320.51
5.5.350.0130.07320.31
5.5.340.0100.07717.96
5.5.330.0100.06720.25
5.5.320.0200.04020.34
5.5.310.0270.05020.26
5.5.300.0030.05718.03
5.5.290.0070.04018.04
5.5.280.0000.05320.90
5.5.270.0070.09020.78
5.5.260.0100.08020.64
5.5.250.0030.04320.68
5.5.240.0230.07320.29
5.4.450.0600.05019.70
5.4.440.0670.05319.45
5.4.430.0800.05319.20
5.4.420.0770.06319.55
5.4.410.0870.04719.30
5.4.400.0630.05018.87
5.4.390.0570.05718.87
5.4.380.0570.05319.25
5.4.370.0630.04718.84
5.4.360.0600.05319.11
5.4.350.0630.08319.38
5.4.340.0600.05319.13
5.4.320.0600.05719.26
5.4.310.0570.05718.84
5.4.300.0630.05019.22
5.4.290.0630.04319.25
5.4.280.0700.05319.02
5.4.270.0600.05018.83
5.4.260.0870.04019.00
5.4.250.0670.04719.00
5.4.240.0570.05319.12
5.4.230.0600.05019.28
5.4.220.0430.06019.37
5.4.210.0600.05719.13
5.4.200.0500.07018.96
5.4.190.0670.05719.12
5.4.180.0630.05019.27
5.4.170.0630.05319.12
5.4.160.0570.05719.23
5.4.150.0600.05719.11
5.4.140.0570.06016.36
5.4.130.0600.04716.51
5.4.120.0670.04016.53
5.4.110.0600.05016.59
5.4.100.0500.05716.53
5.4.90.0500.05316.57
5.4.80.0570.04716.23
5.4.70.0000.05016.34
5.4.60.0400.06316.56
5.4.50.0000.07316.23
5.4.40.0230.04716.51
5.4.30.0030.03316.47
5.4.20.0130.04016.50

preferences:
61.46 ms | 401 KiB | 5 Q