3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Iterators\Classes; class FizzBuzz implements \Iterator { protected $pointer = 0; protected $numbers = []; public function __construct($numbers=[]) { $this->numbers = $numbers; return; } public function current() { $returnValue = ''; $returnValue .= ($this->numbers[$this->pointer]%3===0?'Fizz':''); $returnValue .= ($this->numbers[$this->pointer]%5===0?'Buzz':''); $returnValue = (empty($returnValue)?$this->numbers[$this->pointer]:$returnValue); return $returnValue; } public function key() { return $this->pointer; } public function next() { $this->pointer++; return; } public function rewind() { $this->pointer=0; return; } public function valid() { return isset($this->numbers[$this->pointer]); } }; $fizz = new FizzBuzz(2, 3, 3); var_dump($fizz);

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.0120.00416.63
8.3.50.0070.01121.88
8.3.40.0140.00718.77
8.3.30.0070.00719.01
8.3.20.0070.00020.34
8.3.10.0060.00321.67
8.3.00.0040.00419.25
8.2.180.0210.00016.38
8.2.170.0110.00422.96
8.2.160.0000.01720.38
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0000.00819.77
8.2.110.0070.00420.93
8.2.100.0070.00417.63
8.2.90.0040.00419.18
8.2.80.0060.00317.97
8.2.70.0030.00617.48
8.2.60.0100.00018.04
8.2.50.0040.00718.07
8.2.40.0040.00418.08
8.2.30.0030.00617.95
8.2.20.0000.00817.66
8.2.10.0000.00817.99
8.2.00.0030.00517.56
8.1.280.0040.01525.92
8.1.270.0080.00018.90
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.97
8.1.230.0040.00818.76
8.1.220.0000.00817.76
8.1.210.0060.00318.77
8.1.200.0080.00017.47
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0090.00020.37
8.1.160.0080.00022.03
8.1.150.0040.00418.91
8.1.140.0040.00417.33
8.1.130.0020.00517.82
8.1.120.0050.00217.37
8.1.110.0040.00417.38
8.1.100.0050.00217.33
8.1.90.0050.00317.36
8.1.80.0070.00017.35
8.1.70.0000.00817.49
8.1.60.0000.00717.61
8.1.50.0040.00417.45
8.1.40.0030.00517.58
8.1.30.0050.00317.66
8.1.20.0080.00017.54
8.1.10.0060.00317.46
8.1.00.0040.00417.34
8.0.300.0080.00018.77
8.0.290.0000.00716.63
8.0.280.0030.00318.37
8.0.270.0000.00716.83
8.0.260.0030.00317.28
8.0.250.0000.00716.84
8.0.240.0000.00916.89
8.0.230.0030.00316.87
8.0.220.0040.00416.79
8.0.210.0070.00016.80
8.0.200.0070.00016.82
8.0.190.0030.00316.98
8.0.180.0050.00216.93
8.0.170.0000.00916.93
8.0.160.0040.00417.00
8.0.150.0070.00016.82
8.0.140.0000.00716.93
8.0.130.0060.00013.38
8.0.120.0080.00016.89
8.0.110.0040.00416.93
8.0.100.0040.00416.89
8.0.90.0040.00416.79
8.0.80.0060.01016.86
8.0.70.0000.00817.01
8.0.60.0050.00316.70
8.0.50.0000.00716.83
8.0.30.0130.00816.88
8.0.20.0100.01017.40
8.0.10.0040.00416.92
8.0.00.0080.01116.81
7.4.330.0000.00515.03
7.4.320.0000.00716.53
7.4.300.0060.00016.51
7.4.290.0000.00816.47
7.4.280.0070.00016.53
7.4.270.0000.00616.66
7.4.260.0000.00716.64
7.4.250.0000.00816.56
7.4.240.0020.00616.47
7.4.230.0070.00016.50
7.4.220.0110.01216.55
7.4.210.0120.00616.54
7.4.200.0030.00316.43
7.4.160.0070.00816.44
7.4.150.0120.00617.40
7.4.140.0130.00517.86
7.4.130.0090.00816.58
7.4.120.0110.00616.49
7.4.110.0060.01316.47
7.4.100.0110.00616.49
7.4.90.0120.01216.61
7.4.80.0120.00919.39
7.4.70.0110.00816.49
7.4.60.0150.00316.65
7.4.50.0040.00416.36
7.4.40.0040.01416.50
7.4.30.0060.01516.58
7.4.00.0100.00314.75
7.3.330.0080.00013.11
7.3.320.0060.00613.18
7.3.310.0000.00716.11
7.3.300.0000.00716.10
7.3.290.0080.00616.23
7.3.280.0110.00516.23
7.3.270.0110.00817.40
7.3.260.0030.01516.55
7.3.250.0160.00516.28
7.3.240.0160.01016.30
7.3.230.0150.00916.50
7.3.210.0040.01216.27
7.3.200.0120.00819.39
7.3.190.0000.01716.49
7.3.180.0060.01016.23
7.3.170.0130.00316.27
7.3.160.0160.00616.40
7.2.330.0090.00916.70
7.2.320.0100.01116.61
7.2.310.0070.01416.32
7.2.300.0090.00916.52
7.2.290.0140.00516.72
7.2.60.0100.00316.98
7.1.200.0060.00615.69
7.1.70.0110.00017.27
7.1.60.0030.02119.46
7.1.50.0100.01317.01
7.1.00.0030.07722.42
7.0.200.0050.00316.47
7.0.140.0000.03722.15
7.0.60.0030.08019.88
7.0.50.0000.04317.92
7.0.40.0100.06720.13
7.0.30.0300.05020.06
7.0.20.0270.04320.25
7.0.10.0030.08720.30
7.0.00.0030.09020.07
5.6.280.0070.07021.10
5.6.210.0030.07720.62
5.6.200.0100.07718.25
5.6.190.0130.05320.51
5.6.180.3670.04320.61
5.6.170.0300.05020.55
5.6.160.0170.07320.45
5.6.150.0030.07318.16
5.6.140.0100.03318.22
5.6.130.0000.08018.12
5.6.120.0070.07021.02
5.6.110.0130.08020.98
5.6.100.0170.07320.97
5.6.90.0130.06321.04
5.6.80.0070.07720.51
5.5.350.0000.04020.43
5.5.340.0030.04018.06
5.5.330.0030.05720.27
5.5.320.0270.07320.27
5.5.310.0230.08320.26
5.5.300.0030.04717.91
5.5.290.0070.07017.98
5.5.280.0100.08020.98
5.5.270.0030.07320.80
5.5.260.0070.07020.98
5.5.250.0030.06020.68
5.5.240.3770.03720.16
5.4.450.0130.06019.34
5.4.440.1000.05319.70
5.4.430.0600.07019.38
5.4.420.0800.04719.70
5.4.410.1100.06719.45
5.4.400.0100.06318.81
5.4.390.0300.04318.78
5.4.380.0200.05318.63
5.4.370.0170.05318.84
5.4.360.0130.05318.73
5.4.350.0100.06318.76
5.4.340.0170.05318.54
5.4.320.0130.06318.77
5.4.310.0270.04718.78
5.4.300.0070.06318.73
5.4.290.0200.05018.58
5.4.280.0100.06318.70
5.4.270.0200.05018.72
5.4.260.0200.05718.80
5.4.250.0130.06018.53
5.4.240.0170.06018.46
5.4.230.0230.06718.56
5.4.220.0230.06318.82
5.4.210.0130.06318.77
5.4.200.0130.06016.64
5.4.190.0230.04718.52
5.4.180.0230.04718.59
5.4.170.0170.06318.73
5.4.160.0270.04318.77
5.4.150.0100.05718.74
5.4.140.0170.06316.35
5.4.130.0270.05316.22
5.4.120.0100.07016.26
5.4.110.0170.05016.29
5.4.100.0300.06316.24
5.4.90.0170.05316.43
5.4.80.0200.06016.41
5.4.70.0230.05316.24
5.4.60.0330.04016.25
5.4.50.0170.05016.39
5.4.40.0100.06016.43
5.4.30.0270.04316.30
5.4.20.0170.05716.43
5.4.10.0170.05016.27
5.4.00.0200.04715.90
5.3.290.0170.06014.82
5.3.280.0230.05314.87
5.3.270.0200.06314.69
5.3.260.0270.05314.79
5.3.250.0200.05014.70
5.3.240.0270.04714.79
5.3.230.0030.07014.70
5.3.220.0270.06714.68
5.3.210.0270.06014.76
5.3.200.0330.04714.62
5.3.190.0200.05714.67
5.3.180.0300.04314.67
5.3.170.0170.05314.66
5.3.160.0270.05014.76
5.3.150.0200.05714.84
5.3.140.0300.04714.61
5.3.130.0230.04714.64
5.3.120.0170.05314.74
5.3.110.0100.06314.82
5.3.100.0170.05314.09
5.3.90.0170.06714.18
5.3.80.0230.04714.10
5.3.70.0100.06014.21
5.3.60.0070.06014.00
5.3.50.0170.05013.98
5.3.40.0230.04314.11
5.3.30.0130.05314.01
5.3.20.0170.05313.68
5.3.10.0200.04713.93
5.3.00.0130.05313.72
5.2.170.0070.05711.17
5.2.160.0230.03311.20
5.2.150.0070.04711.12
5.2.140.0170.04011.28
5.2.130.0230.03711.13
5.2.120.0100.04311.06
5.2.110.0130.04011.15
5.2.100.0100.04311.09
5.2.90.0070.05711.16
5.2.80.0100.04311.11
5.2.70.0170.04311.13
5.2.60.0170.05311.05
5.2.50.0130.04311.15
5.2.40.0100.04310.90
5.2.30.0170.03711.01
5.2.20.0170.03711.07
5.2.10.0170.03310.85
5.2.00.0100.04010.77
5.1.60.0070.0379.96
5.1.50.0070.04310.07
5.1.40.0130.03310.03
5.1.30.0100.03710.29
5.1.20.0130.03710.50
5.1.10.0100.05010.17
5.1.00.0100.04010.04
5.0.50.0070.0308.52
5.0.40.0070.0278.47
5.0.30.0100.0438.29
5.0.20.0070.0408.32
5.0.10.0170.0178.19
5.0.00.0130.0408.19
4.4.90.0000.0305.92
4.4.80.0070.0235.81
4.4.70.0070.0205.88
4.4.60.0070.0235.82
4.4.50.0100.0205.96
4.4.40.0030.0435.86
4.4.30.0030.0235.95
4.4.20.0070.0235.98
4.4.10.0000.0275.89
4.4.00.0000.0405.94
4.3.110.0100.0205.80
4.3.100.0070.0235.81
4.3.90.0100.0205.82
4.3.80.0000.0405.91
4.3.70.0070.0205.78
4.3.60.0030.0235.81
4.3.50.0070.0235.86
4.3.40.0070.0335.76
4.3.30.0070.0234.68
4.3.20.0030.0234.51
4.3.10.0000.0274.52
4.3.00.0070.0236.91

preferences:
38.69 ms | 401 KiB | 5 Q