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, 12); $fizz->current();

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.0070.00716.88
8.3.60.0040.01216.63
8.3.50.0120.01021.99
8.3.40.0130.00718.73
8.3.30.0100.01019.07
8.3.20.0070.00020.33
8.3.10.0030.00621.74
8.3.00.0040.00419.38
8.2.180.0150.00318.29
8.2.170.0090.00922.96
8.2.160.0140.00020.48
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00719.79
8.2.110.0100.00022.27
8.2.100.0060.00617.75
8.2.90.0080.00019.22
8.2.80.0000.00917.97
8.2.70.0060.00317.49
8.2.60.0000.00818.04
8.2.50.0030.00718.07
8.2.40.0030.00618.28
8.2.30.0060.00318.12
8.2.20.0000.00717.76
8.2.10.0030.00618.13
8.2.00.0000.00717.63
8.1.280.0070.00725.92
8.1.270.0120.00318.95
8.1.260.0050.00326.35
8.1.250.0060.00328.09
8.1.240.0060.00323.82
8.1.230.0030.00918.77
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0070.00417.35
8.1.190.0050.00317.36
8.1.180.0080.00018.10
8.1.170.0000.00820.44
8.1.160.0040.00422.07
8.1.150.0070.00018.90
8.1.140.0040.00417.36
8.1.130.0050.00217.80
8.1.120.0040.00417.51
8.1.110.0030.00517.52
8.1.100.0000.00817.41
8.1.90.0080.00017.36
8.1.80.0070.00017.46
8.1.70.0030.00317.51
8.1.60.0060.00317.64
8.1.50.0040.00417.56
8.1.40.0040.00417.49
8.1.30.0030.00617.52
8.1.20.0000.00717.65
8.1.10.0000.00717.58
8.1.00.0050.00217.54
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0000.00718.46
8.0.270.0000.00717.26
8.0.260.0000.00617.17
8.0.250.0030.00316.95
8.0.240.0080.00016.93
8.0.230.0040.00416.91
8.0.220.0040.00416.98
8.0.210.0030.00316.96
8.0.200.0050.00317.10
8.0.190.0070.00016.98
8.0.180.0000.00717.00
8.0.170.0000.00816.90
8.0.160.0090.00016.96
8.0.150.0030.00316.82
8.0.140.0070.00016.95
8.0.130.0060.00013.39
8.0.120.0040.00416.83
8.0.110.0000.00716.93
8.0.100.0000.00716.77
8.0.90.0040.00417.08
8.0.80.0030.01416.93
8.0.70.0050.00316.84
8.0.60.0080.00017.00
8.0.50.0070.00016.77
8.0.30.0110.01117.11
8.0.20.0100.01217.40
8.0.10.0050.00317.20
8.0.00.0110.00716.86
7.4.330.0050.00015.03
7.4.320.0000.00616.45
7.4.300.0030.00616.61
7.4.290.0000.00816.61
7.4.280.0000.00716.56
7.4.270.0040.00416.64
7.4.260.0000.00716.46
7.4.250.0040.00416.61
7.4.240.0020.00616.55
7.4.230.0030.00316.39
7.4.220.0070.01116.60
7.4.210.0100.00616.68
7.4.200.0030.00316.63
7.4.160.0070.00716.62
7.4.150.0160.00317.40
7.4.140.0110.01017.86
7.4.130.0100.00816.46
7.4.120.0100.00816.50
7.4.110.0160.00616.79
7.4.100.0060.01116.39
7.4.90.0180.00016.49
7.4.80.0090.01019.39
7.4.70.0040.01216.63
7.4.60.0060.00916.59
7.4.50.0030.00516.48
7.4.40.0140.00316.62
7.4.30.0100.01316.59
7.4.00.0070.00914.91
7.3.330.0040.00413.36
7.3.320.0000.01313.15
7.3.310.0030.00316.37
7.3.300.0000.00716.29
7.3.290.0050.00916.39
7.3.280.0120.00616.39
7.3.270.0130.00517.40
7.3.260.0130.01016.38
7.3.250.0130.00716.45
7.3.240.0080.00916.58
7.3.230.0070.01716.50
7.3.210.0060.01016.29
7.3.200.0160.00619.39
7.3.190.0060.00916.32
7.3.180.0120.00316.40
7.3.170.0100.00916.38
7.3.160.0090.01216.36
7.3.120.0100.00714.78
7.3.110.0090.00614.73
7.3.100.0120.00314.72
7.3.90.0100.00314.66
7.3.80.0060.00614.86
7.3.70.0070.00314.54
7.3.60.0100.00715.00
7.3.50.0090.00314.74
7.3.40.0030.01014.42
7.3.30.0070.00714.80
7.3.20.0060.00916.66
7.3.10.0080.00616.41
7.3.00.0040.01016.63
7.2.330.0110.00816.90
7.2.320.0090.01216.76
7.2.310.0120.01016.71
7.2.300.0170.00016.82
7.2.290.0080.01216.79
7.2.250.0060.01214.89
7.2.240.0030.01615.09
7.2.230.0040.00714.75
7.2.220.0030.01315.03
7.2.210.0040.01115.32
7.2.200.0030.00815.31
7.2.190.0070.01115.07
7.2.180.0110.00315.01
7.2.170.0070.00715.16
7.2.130.0000.01617.06
7.2.120.0030.00616.72
7.2.110.0000.00916.75
7.2.100.0090.00616.93
7.2.90.0090.00316.94
7.2.80.0060.00617.14
7.2.70.0030.00616.96
7.2.60.0060.00916.98
7.2.50.0060.01016.82
7.2.40.0110.00316.80
7.2.30.0090.00017.01
7.2.20.0110.00417.04
7.2.10.0060.00616.79
7.2.00.0030.01018.26
7.1.330.0100.00715.68
7.1.320.0060.00315.95
7.1.310.0030.01015.91
7.1.300.0000.00915.93
7.1.290.0000.01315.74
7.1.280.0100.00615.66
7.1.270.0030.01015.86
7.1.260.0030.00715.96
7.1.250.0000.00815.57
7.1.100.0050.00817.81
7.1.70.0090.00617.29
7.1.60.0060.01819.46
7.1.50.0120.01217.00
7.1.00.0070.07322.36
7.0.200.0040.00416.55
7.0.140.0000.04022.05
7.0.60.0030.07319.98
7.0.50.0100.08017.98
7.0.40.0070.05019.96
7.0.30.0170.04720.11
7.0.20.0170.06020.26
7.0.10.0230.08320.24
7.0.00.0100.05020.12
5.6.280.0030.06721.13
5.6.210.0130.04020.71
5.6.200.0030.08718.28
5.6.190.0070.04020.54
5.6.180.0270.08020.75
5.6.170.0370.04020.47
5.6.160.0100.08020.52
5.6.150.0030.04018.29
5.6.140.0030.06018.29
5.6.130.0030.04018.14
5.6.120.0030.05021.14
5.6.110.0200.08020.98
5.6.100.0030.04020.89
5.6.90.0100.08321.00
5.6.80.0070.05720.54
5.6.70.0230.07320.42
5.5.350.0030.07720.35
5.5.340.0070.08718.07
5.5.330.0070.04720.27
5.5.320.0030.08020.47
5.5.310.0370.07020.30
5.5.300.0030.07317.92
5.5.290.0000.04718.10
5.5.280.0070.03720.89
5.5.270.0070.08720.79
5.5.260.0070.04020.83
5.5.250.0170.07020.59
5.5.240.0100.05320.25
5.4.450.0530.06019.48
5.4.440.0400.04019.27
5.4.430.0430.07019.58
5.4.420.0400.03719.54
5.4.410.0300.04319.44
5.4.400.0300.03719.06
5.4.390.0270.04019.24
5.4.380.0370.04018.87
5.4.370.0300.03718.99
5.4.360.0300.03719.20
5.4.350.0330.04018.87
5.4.340.0370.03019.14
5.4.320.0300.04018.95
5.4.310.0400.02718.87
5.4.300.0270.04019.21
5.4.290.0270.04019.26
5.4.280.0370.03019.13
5.4.270.0430.04019.00
5.4.260.0300.04719.14
5.4.250.0330.03019.21
5.4.240.0330.07018.97
5.4.230.0500.06019.05
5.4.220.0330.03719.19
5.4.210.0470.05718.97
5.4.200.0400.05018.86
5.4.190.0400.04319.23
5.4.180.0270.04719.21
5.4.170.0500.06019.21
5.4.160.0500.03019.20
5.4.150.0330.04018.85
5.4.140.0530.05716.36
5.4.130.0530.05716.32
5.4.120.0400.03316.35
5.4.110.0330.03716.19
5.4.100.0470.05316.59
5.4.90.0500.05016.35
5.4.80.0430.06716.50
5.4.70.0370.03716.35
5.4.60.0470.03316.56
5.4.50.0570.05716.43
5.4.40.0500.03716.48
5.4.30.0430.03716.34
5.4.20.0370.05316.25
5.4.10.0370.03716.52
5.4.00.0470.06315.78
5.3.290.0330.03314.67
5.3.280.0400.04314.50
5.3.270.0330.04014.57
5.3.260.0330.04014.57
5.3.250.0330.04014.50
5.3.240.0500.04714.82
5.3.230.0470.06014.71
5.3.220.0430.03014.70
5.3.210.0430.03314.72
5.3.200.0500.05714.56
5.3.190.0530.05014.56
5.3.180.0670.03014.61
5.3.170.0400.06714.52
5.3.160.0330.04314.61
5.3.150.0330.04014.55
5.3.140.0470.05314.63
5.3.130.0400.04314.59
5.3.120.0330.04014.62
5.3.110.0370.03714.76
5.3.100.0500.05714.01
5.3.90.0400.04013.94
5.3.80.0400.03013.98
5.3.70.0270.04013.92
5.3.60.0230.04313.93
5.3.50.0270.04014.10
5.3.40.0470.06713.86
5.3.30.0570.03713.81
5.3.20.0370.03713.59
5.3.10.0430.05713.83
5.3.00.0430.03313.56
5.2.170.0430.04011.66
5.2.160.0400.05011.66
5.2.150.0630.02311.66
5.2.140.0430.05011.66
5.2.130.0400.04311.66
5.2.120.0300.05711.66
5.2.110.0370.05711.66
5.2.100.0430.04711.66
5.2.90.0230.03011.66
5.2.80.0330.03711.66
5.2.70.0370.05011.66
5.2.60.0370.05011.66
5.2.50.0470.04711.66
5.2.40.0330.05011.66
5.2.30.0270.04011.66
5.2.20.0300.05711.66
5.2.10.0200.03311.66
5.2.00.0270.02311.66
5.1.60.0200.03711.66
5.1.50.0230.03311.66
5.1.40.0230.03311.66
5.1.30.0230.02311.66
5.1.20.0370.02711.66
5.1.10.0400.04311.66
5.1.00.0400.04311.66
5.0.50.0170.03011.66
5.0.40.0130.03711.66
5.0.30.0170.06011.66
5.0.20.0230.03311.66
5.0.10.0200.03711.66
5.0.00.0170.03711.66
4.4.90.0130.02311.66
4.4.80.0170.03011.66
4.4.70.0100.01711.66
4.4.60.0100.01711.66
4.4.50.0130.01711.66
4.4.40.0130.03711.66
4.4.30.0170.02011.66
4.4.20.0170.02311.66
4.4.10.0170.02311.66
4.4.00.0100.03311.66
4.3.110.0170.02011.66
4.3.100.0130.03011.66
4.3.90.0170.02711.66
4.3.80.0230.02311.66
4.3.70.0200.02011.66
4.3.60.0170.02011.66
4.3.50.0200.03011.66
4.3.40.0200.04311.66
4.3.30.0100.03711.66
4.3.20.0070.03011.66
4.3.10.0070.03011.66
4.3.00.0130.03011.66

preferences:
56.55 ms | 401 KiB | 5 Q