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.60.0150.00616.63
8.3.50.0110.00822.05
8.3.40.0110.00418.70
8.3.30.0070.00718.89
8.3.20.0070.00020.21
8.3.10.0030.00621.61
8.3.00.0040.00419.00
8.2.180.0190.00318.66
8.2.170.0030.01422.96
8.2.160.0030.01020.18
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00019.77
8.2.110.0090.00020.83
8.2.100.0080.00417.75
8.2.90.0000.00819.08
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0040.00418.04
8.2.50.0060.00318.07
8.2.40.0060.00319.82
8.2.30.0040.00418.01
8.2.20.0040.00417.57
8.2.10.0070.00018.14
8.2.00.0030.00517.76
8.1.280.0150.00625.92
8.1.270.0090.00018.95
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00324.02
8.1.230.0030.00918.85
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0040.00417.25
8.1.180.0080.00018.10
8.1.170.0040.00420.50
8.1.160.0000.00822.03
8.1.150.0050.00319.02
8.1.140.0040.00417.39
8.1.130.0040.00417.96
8.1.120.0040.00417.39
8.1.110.0040.00417.54
8.1.100.0000.00717.44
8.1.90.0040.00417.46
8.1.80.0000.00817.36
8.1.70.0030.00317.50
8.1.60.0040.00417.45
8.1.50.0000.00917.54
8.1.40.0030.00617.41
8.1.30.0060.00317.56
8.1.20.0040.00417.60
8.1.10.0030.00517.47
8.1.00.0000.00717.36
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0030.00318.38
8.0.270.0040.00417.15
8.0.260.0030.00317.22
8.0.250.0000.00716.86
8.0.240.0030.00316.84
8.0.230.0000.00717.02
8.0.220.0070.00016.88
8.0.210.0000.00816.83
8.0.200.0000.00716.84
8.0.190.0000.00817.01
8.0.180.0030.00617.00
8.0.170.0060.00316.97
8.0.160.0000.00816.93
8.0.150.0030.00316.88
8.0.140.0070.00016.83
8.0.130.0030.00313.29
8.0.120.0060.00316.80
8.0.110.0070.00016.84
8.0.100.0000.00716.94
8.0.90.0030.00516.76
8.0.80.0130.00316.89
8.0.70.0040.00416.94
8.0.60.0000.00716.73
8.0.50.0000.00717.03
8.0.30.0190.00917.10
8.0.20.0150.00417.40
8.0.10.0030.00517.02
8.0.00.0160.00216.67
7.4.330.0000.00515.09
7.4.320.0060.00016.41
7.4.300.0040.00416.70
7.4.290.0090.00016.52
7.4.280.0030.00516.52
7.4.270.0030.00316.38
7.4.260.0040.00416.50
7.4.250.0000.00716.46
7.4.240.0050.00316.54
7.4.230.0030.00316.73
7.4.220.0040.01816.61
7.4.210.0070.00716.56
7.4.200.0040.00416.32
7.4.160.0040.01216.60
7.4.150.0090.01217.40
7.4.140.0080.00817.86
7.4.130.0150.00516.37
7.4.120.0100.00616.47
7.4.110.0030.01616.60
7.4.100.0120.00916.43
7.4.90.0090.01416.44
7.4.80.0140.00419.39
7.4.70.0150.00416.32
7.4.60.0090.01016.59
7.4.50.0020.00216.29
7.4.40.0080.00816.31
7.4.30.0150.00716.66
7.4.00.0060.01015.11
7.3.330.0030.00313.25
7.3.320.0080.00413.22
7.3.310.0060.00016.11
7.3.300.0030.00316.25
7.3.290.0090.00916.28
7.3.280.0080.00916.23
7.3.270.0070.01317.40
7.3.260.0110.00616.38
7.3.250.0120.00616.37
7.3.240.0130.01016.48
7.3.230.0130.00616.39
7.3.210.0070.01016.41
7.3.200.0040.01219.39
7.3.190.0060.01016.38
7.3.180.0160.00316.52
7.3.170.0090.00916.27
7.3.160.0140.00516.37
7.2.330.0080.01216.71
7.2.320.0180.00616.85
7.2.310.0130.00316.85
7.2.300.0090.00916.69
7.2.290.0130.01016.45
7.2.60.0070.00716.46
7.2.00.0000.01219.38
7.1.200.0100.00315.46
7.1.100.0040.00718.09
7.1.70.0030.00317.27
7.1.60.0130.01019.46
7.1.50.0090.01216.93
7.1.00.0030.07722.41
7.0.200.0030.00716.55
7.0.140.0070.03322.12
7.0.60.0070.04319.90
7.0.50.0100.07717.88
7.0.40.0070.05720.12
7.0.30.0230.04320.07
7.0.20.0270.08020.36
7.0.10.0230.04020.24
7.0.00.0130.07320.15
5.6.280.0030.06720.91
5.6.210.0000.04320.71
5.6.200.0070.04018.19
5.6.190.0100.03720.60
5.6.180.0300.04720.75
5.6.170.0330.07320.46
5.6.160.0030.08020.57
5.6.150.0070.03718.15
5.6.140.0070.04718.18
5.6.130.0000.04718.25
5.6.120.0130.05321.00
5.6.110.0070.08321.01
5.6.100.0170.07320.95
5.6.90.0030.06021.02
5.6.80.0100.04320.54
5.6.70.0270.07320.44
5.5.350.0070.07320.45
5.5.340.0070.08017.96
5.5.330.0070.03720.47
5.5.320.0100.07720.41
5.5.310.0230.07320.30
5.5.300.0070.08317.95
5.5.290.0100.03717.98
5.5.280.0000.04320.99
5.5.270.0100.06020.80
5.5.260.0070.03720.90
5.5.250.0100.07720.57
5.5.240.0100.04320.38
5.4.450.0270.06319.55
5.4.440.0330.07019.46
5.4.430.0270.08019.50
5.4.420.0300.04719.31
5.4.410.0200.04319.36
5.4.400.0270.03319.14
5.4.390.0330.07018.99
5.4.380.0270.03719.23
5.4.370.0230.05019.24
5.4.360.0330.06718.85
5.4.350.0300.07018.99
5.4.340.0300.06719.22
5.4.320.0300.06018.85
5.4.310.0330.06719.20
5.4.300.0200.04019.06
5.4.290.0200.04019.30
5.4.280.0370.04019.14
5.4.270.0330.07319.23
5.4.260.0430.05019.18
5.4.250.0270.04719.30
5.4.240.0230.03718.93
5.4.230.0330.06019.08
5.4.220.0300.05019.21
5.4.210.0270.04719.14
5.4.200.0300.07018.98
5.4.190.0230.05318.86
5.4.180.0270.07319.18
5.4.170.0400.06719.21
5.4.160.0400.03718.96
5.4.150.0230.05019.14
5.4.140.0400.04016.51
5.4.130.0230.03716.33
5.4.120.0370.06016.50
5.4.110.0230.03716.37
5.4.100.0300.06316.37
5.4.90.0330.06716.51
5.4.80.0270.04716.52
5.4.70.0370.05316.57
5.4.60.0200.04016.17
5.4.50.0370.05716.25
5.4.40.0270.06316.28
5.4.30.0270.05316.53
5.4.20.0330.05716.43
5.4.10.0270.03316.52
5.4.00.0300.06715.96
5.3.290.0400.03714.65
5.3.280.0230.04014.49
5.3.270.0400.06014.61
5.3.260.0400.06314.56
5.3.250.0300.05714.52
5.3.240.0370.03314.52
5.3.230.0230.04014.50
5.3.220.0200.04714.55
5.3.210.0270.06014.47
5.3.200.0330.07014.57
5.3.190.0270.05714.66
5.3.180.0300.04314.48
5.3.170.0300.03314.56
5.3.160.0270.06014.42
5.3.150.0270.07314.61
5.3.140.0330.06714.57
5.3.130.0400.06314.52
5.3.120.0230.07714.56
5.3.110.0270.04714.59
5.3.100.0230.04014.03
5.3.90.0370.06314.24
5.3.80.0370.07314.10
5.3.70.0370.06313.98
5.3.60.0370.06314.12
5.3.50.0370.06013.84
5.3.40.0400.06713.86
5.3.30.0300.03713.92
5.3.20.0300.06713.77
5.3.10.0300.06013.81
5.3.00.0230.07013.86
5.2.170.0300.04010.99
5.2.160.0230.05311.00
5.2.150.0400.03010.98
5.2.140.0300.05711.00
5.2.130.0200.03711.00
5.2.120.0230.03310.94
5.2.110.0200.05710.98
5.2.100.0200.03711.15
5.2.90.0230.04311.04
5.2.80.0270.06010.98
5.2.70.0270.05010.95
5.2.60.0300.05710.90
5.2.50.0300.05011.03
5.2.40.0270.05310.89
5.2.30.0230.05310.82
5.2.20.0170.03710.79
5.2.10.0330.04710.95
5.2.00.0370.02310.87
5.1.60.0230.02310.00
5.1.50.0200.05010.05
5.1.40.0070.0379.91
5.1.30.0170.05310.33
5.1.20.0200.05010.50
5.1.10.0200.04010.04
5.1.00.0170.05310.16
5.0.50.0130.0139.74
5.0.40.0100.0209.74
5.0.30.0100.0509.74
5.0.20.0070.0239.74
5.0.10.0200.0309.74
5.0.00.0070.0509.74
4.4.90.0100.0239.74
4.4.80.0100.0239.74
4.4.70.0100.0139.74
4.4.60.0070.0209.74
4.4.50.0100.0179.74
4.4.40.0070.0409.74
4.4.30.0000.0209.74
4.4.20.0070.0379.74
4.4.10.0070.0209.74
4.4.00.0100.0279.74
4.3.110.0100.0379.74
4.3.100.0070.0209.74
4.3.90.0130.0309.74
4.3.80.0100.0539.74
4.3.70.0130.0309.74
4.3.60.0070.0209.74
4.3.50.0100.0339.74
4.3.40.0070.0539.74
4.3.30.0100.0309.74
4.3.20.0100.0239.74
4.3.10.0030.0379.74
4.3.00.0030.0339.74

preferences:
49.05 ms | 401 KiB | 5 Q