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(); 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.70.0120.00316.63
8.3.60.0100.01317.00
8.3.50.0080.01021.99
8.3.40.0110.00418.71
8.3.30.0060.00919.00
8.3.20.0050.00320.31
8.3.10.0080.00021.76
8.3.00.0050.00319.25
8.2.190.0110.00417.00
8.2.180.0160.00618.29
8.2.170.0190.00022.96
8.2.160.0110.00720.22
8.2.150.0090.00024.18
8.2.140.0030.00524.66
8.2.130.0070.00026.16
8.2.120.0040.00419.54
8.2.110.0000.00921.04
8.2.100.0100.00017.72
8.2.90.0000.00819.17
8.2.80.0050.00317.97
8.2.70.0000.00817.38
8.2.60.0080.00018.03
8.2.50.0030.00618.07
8.2.40.0050.00318.22
8.2.30.0040.00418.13
8.2.20.0000.00717.58
8.2.10.0050.00318.00
8.2.00.0000.00817.61
8.1.280.0140.00725.92
8.1.270.0040.00418.90
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0040.00722.53
8.1.230.0110.00020.95
8.1.220.0080.00017.79
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0080.00017.23
8.1.180.0070.00018.10
8.1.170.0080.00020.22
8.1.160.0050.00221.94
8.1.150.0000.00718.91
8.1.140.0040.00417.46
8.1.130.0000.00817.95
8.1.120.0000.00717.53
8.1.110.0080.00017.45
8.1.100.0000.00817.45
8.1.90.0040.00417.45
8.1.80.0000.00817.47
8.1.70.0000.00817.39
8.1.60.0060.00317.61
8.1.50.0050.00317.61
8.1.40.0040.00417.51
8.1.30.0050.00317.60
8.1.20.0060.00317.73
8.1.10.0050.00217.39
8.1.00.0030.00517.34
8.0.300.0030.00518.77
8.0.290.0000.00716.75
8.0.280.0070.00018.46
8.0.270.0070.00017.19
8.0.260.0000.00617.29
8.0.250.0030.00316.94
8.0.240.0000.00617.02
8.0.230.0070.00016.90
8.0.220.0050.00216.80
8.0.210.0000.00716.87
8.0.200.0070.00016.86
8.0.190.0040.00416.96
8.0.180.0020.00516.86
8.0.170.0060.00316.88
8.0.160.0040.00416.93
8.0.150.0000.00816.87
8.0.140.0040.00416.87
8.0.130.0000.00613.30
8.0.120.0030.00516.89
8.0.110.0040.00416.82
8.0.100.0000.00716.94
8.0.90.0000.00716.87
8.0.80.0060.01016.84
8.0.70.0040.00416.84
8.0.60.0040.00416.80
8.0.50.0050.00216.92
8.0.30.0100.01317.00
8.0.20.0090.01217.40
8.0.10.0050.00217.04
8.0.00.0110.00816.80
7.4.330.0000.00615.03
7.4.320.0030.00316.63
7.4.300.0030.00616.59
7.4.290.0060.00316.60
7.4.280.0040.00416.64
7.4.270.0070.00016.38
7.4.260.0070.00016.58
7.4.250.0000.00816.50
7.4.240.0020.00516.56
7.4.230.0030.00316.42
7.4.220.0170.00616.41
7.4.210.0100.00616.52
7.4.200.0030.00316.62
7.4.160.0130.00316.62
7.4.150.0190.00017.40
7.4.140.0100.01017.86
7.4.130.0070.01016.51
7.4.120.0090.00816.45
7.4.110.0060.01216.59
7.4.100.0070.01016.54
7.4.90.0090.00916.63
7.4.80.0100.01019.39
7.4.70.0120.01216.59
7.4.60.0070.01016.68
7.4.50.0040.00016.41
7.4.40.0180.00316.27
7.4.30.0110.01116.59
7.4.00.0040.01114.67
7.3.330.0030.00513.07
7.3.320.0050.00913.17
7.3.310.0030.00316.27
7.3.300.0060.00016.07
7.3.290.0040.01016.23
7.3.280.0110.00616.21
7.3.270.0110.00717.40
7.3.260.0210.00316.48
7.3.250.0160.00716.42
7.3.240.0040.01316.38
7.3.230.0180.00716.51
7.3.210.0040.01216.32
7.3.200.0100.00619.39
7.3.190.0110.01116.31
7.3.180.0140.00516.51
7.3.170.0060.01216.32
7.3.160.0100.00716.47
7.3.10.0000.01116.27
7.3.00.0000.01216.76
7.2.330.0120.00616.48
7.2.320.0150.00616.40
7.2.310.0090.00816.63
7.2.300.0140.00316.69
7.2.290.0170.00716.71
7.2.130.0000.00916.88
7.2.120.0040.01216.63
7.2.110.0060.00816.92
7.2.100.0030.00616.66
7.2.90.0030.01316.86
7.2.80.0080.00417.02
7.2.70.0050.00516.66
7.2.60.0070.00717.00
7.2.50.0090.00616.86
7.2.40.0040.00816.89
7.2.30.0060.00916.87
7.2.20.0030.00716.68
7.2.10.0040.01116.90
7.2.00.0050.00717.92
7.1.250.0070.00315.92
7.1.200.0040.00715.52
7.1.100.0060.00618.04
7.1.70.0000.00717.13
7.1.60.0100.01319.46
7.1.50.0090.00917.09
7.1.00.0070.07322.44
7.0.200.0030.00616.63
7.0.140.0030.06721.99
7.0.60.0070.08719.95
7.0.50.0070.07717.73
7.0.40.0130.04320.18
7.0.30.0200.07320.21
7.0.20.0170.05720.15
7.0.10.0370.07320.33
7.0.00.0170.08020.15
5.6.280.0100.06721.16
5.6.210.0100.07720.54
5.6.200.0130.06718.34
5.6.190.0030.04720.61
5.6.180.0200.08020.46
5.6.170.0370.06020.48
5.6.160.0030.09020.46
5.6.150.0000.04318.18
5.6.140.0000.08318.17
5.6.130.0100.08018.27
5.6.120.0070.04020.98
5.6.110.0130.05721.02
5.6.100.0100.03321.14
5.6.90.0130.06721.09
5.6.80.0030.07720.29
5.6.70.0330.06720.36
5.5.350.0070.06720.42
5.5.340.0070.08018.04
5.5.330.0030.04320.34
5.5.320.0000.08720.47
5.5.310.0370.04020.19
5.5.300.0100.07717.94
5.5.290.0100.07718.08
5.5.280.0070.04320.90
5.5.270.0130.08320.86
5.5.260.0030.05720.97
5.5.250.0030.08320.56
5.5.240.0030.08720.08
5.4.450.0100.06019.48
5.4.440.0800.06019.58
5.4.430.0300.06719.33
5.4.420.0870.06019.61
5.4.410.0370.06019.34
5.4.400.0730.05718.63
5.4.390.0800.05318.57
5.4.380.0770.06318.84
5.4.370.0830.06318.76
5.4.360.0800.06018.61
5.4.350.1100.06318.74
5.4.340.0770.06318.75
5.4.320.0900.05318.73
5.4.310.1030.05018.78
5.4.300.0930.05718.78
5.4.290.0770.05718.56
5.4.280.0830.05718.77
5.4.270.0800.05318.62
5.4.260.0800.04318.60
5.4.250.0830.05318.83
5.4.240.0570.08018.80
5.4.230.0970.05718.46
5.4.220.0800.04718.60
5.4.210.0270.06718.74
5.4.200.0170.07316.50
5.4.190.0070.08018.69
5.4.180.0200.07018.50
5.4.170.0200.05318.58
5.4.160.0330.04018.76
5.4.150.0200.05018.68
5.4.140.0100.06316.22
5.4.130.0270.06316.20
5.4.120.0230.06316.46
5.4.110.0230.05316.44
5.4.100.0270.05716.30
5.4.90.0270.05016.27
5.4.80.0170.06316.45
5.4.70.0330.05316.32
5.4.60.0270.04716.20
5.4.50.0170.05016.40
5.4.40.0200.05016.40
5.4.30.0130.05316.26
5.4.20.0130.05316.26
5.4.10.0070.06016.41
5.4.00.0270.05015.69
5.3.290.0300.06014.68
5.3.280.0130.05314.59
5.3.270.0270.06314.80
5.3.260.0070.06714.80
5.3.250.0270.04314.69
5.3.240.0170.05714.80
5.3.230.0230.05714.61
5.3.220.0130.05714.84
5.3.210.0100.06314.60
5.3.200.0100.06314.76
5.3.190.0170.05314.54
5.3.180.0130.06314.56
5.3.170.0170.05714.61
5.3.160.0270.04714.66
5.3.150.0230.04714.74
5.3.140.0100.05714.66
5.3.130.0200.05014.57
5.3.120.0200.05014.59
5.3.110.0230.05014.56
5.3.100.0170.07714.05
5.3.90.0100.07714.18
5.3.80.0200.06714.21
5.3.70.0100.05314.07
5.3.60.0100.05714.14
5.3.50.0230.05014.04
5.3.40.0170.05313.99
5.3.30.0170.05013.94
5.3.20.0130.05713.96
5.3.10.0270.04313.64
5.3.00.0200.04313.67
5.2.170.0170.04311.09
5.2.160.0130.05311.28
5.2.150.0170.05311.13
5.2.140.0030.05011.19
5.2.130.0070.04311.08
5.2.120.0100.05011.25
5.2.110.0170.05311.03
5.2.100.0230.05011.16
5.2.90.0170.05311.15
5.2.80.0200.05311.04
5.2.70.0070.07311.08
5.2.60.0170.04010.98
5.2.50.0070.05311.17
5.2.40.0130.05011.12
5.2.30.0170.04710.95
5.2.20.0130.03710.93
5.2.10.0130.03710.92
5.2.00.0130.03710.78
5.1.60.0030.04010.00
5.1.50.0130.03010.01
5.1.40.0170.03010.04
5.1.30.0100.05010.31
5.1.20.0170.04010.41
5.1.10.0100.03710.16
5.1.00.0100.04710.09
5.0.50.0100.0278.69
5.0.40.0100.0278.39
5.0.30.0130.0438.23
5.0.20.0030.0408.21
5.0.10.0130.0338.20
5.0.00.0130.0378.36
4.4.90.0070.0235.82
4.4.80.0070.0305.86
4.4.70.0130.0175.91
4.4.60.0170.0175.90
4.4.50.0030.0275.82
4.4.40.0100.0335.88
4.4.30.0100.0205.93
4.4.20.0100.0175.92
4.4.10.0130.0175.98
4.4.00.0000.0435.90
4.3.110.0100.0175.86
4.3.100.0030.0305.74
4.3.90.0100.0275.77
4.3.80.0130.0405.79
4.3.70.0070.0305.80
4.3.60.0030.0235.82
4.3.50.0070.0305.86
4.3.40.0070.0375.76
4.3.30.0030.0234.64
4.3.20.0030.0304.64
4.3.10.0000.0274.56
4.3.00.0100.0236.91

preferences:
77.98 ms | 401 KiB | 5 Q