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(15); echo $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.60.0070.01416.50
8.3.50.0140.00418.09
8.3.40.0100.00718.93
8.3.30.0110.00319.21
8.3.20.0050.00320.36
8.3.10.0000.00821.86
8.3.00.0060.00319.26
8.2.180.0120.00618.54
8.2.170.0040.01222.96
8.2.160.0100.00320.38
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0090.00019.66
8.2.110.0040.00722.30
8.2.100.0070.00717.75
8.2.90.0040.00419.23
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0000.00818.16
8.2.50.0060.00318.07
8.2.40.0040.00420.01
8.2.30.0040.00418.01
8.2.20.0000.00817.75
8.2.10.0000.00718.01
8.2.00.0070.00017.63
8.1.280.0060.01325.92
8.1.270.0110.00718.75
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00023.92
8.1.230.0070.00418.85
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.23
8.1.180.0000.00718.10
8.1.170.0040.00420.30
8.1.160.0000.00722.06
8.1.150.0030.00618.91
8.1.140.0000.00717.43
8.1.130.0030.00317.84
8.1.120.0000.00717.54
8.1.110.0000.00817.34
8.1.100.0000.00717.46
8.1.90.0040.00317.50
8.1.80.0050.00317.46
8.1.70.0030.00317.52
8.1.60.0060.00317.51
8.1.50.0040.00417.44
8.1.40.0080.00017.41
8.1.30.0050.00317.57
8.1.20.0040.00417.64
8.1.10.0060.00317.59
8.1.00.0050.00217.45
8.0.300.0040.00418.77
8.0.290.0020.00516.60
8.0.280.0050.00218.44
8.0.270.0030.00317.17
8.0.260.0060.00017.18
8.0.250.0000.00716.94
8.0.240.0030.00316.98
8.0.230.0000.00716.91
8.0.220.0070.00017.00
8.0.210.0040.00416.86
8.0.200.0070.00016.94
8.0.190.0070.00016.99
8.0.180.0050.00216.86
8.0.170.0030.00617.01
8.0.160.0030.00517.07
8.0.150.0040.00416.82
8.0.140.0040.00416.91
8.0.130.0030.00313.43
8.0.120.0000.00816.91
8.0.110.0040.00417.01
8.0.100.0000.00716.80
8.0.90.0040.00416.84
8.0.80.0090.00616.96
8.0.70.0000.00716.92
8.0.60.0040.00417.08
8.0.50.0080.00016.81
8.0.30.0060.01717.22
8.0.20.0140.00517.40
8.0.10.0040.00417.14
8.0.00.0080.01016.98
7.4.330.0020.00215.15
7.4.320.0030.00316.66
7.4.300.0040.00416.63
7.4.290.0050.00316.62
7.4.280.0050.00216.52
7.4.270.0000.00716.60
7.4.260.0070.00016.42
7.4.250.0040.00416.55
7.4.240.0000.00716.55
7.4.230.0000.00716.56
7.4.220.0060.01616.53
7.4.210.0050.01316.60
7.4.200.0030.00516.63
7.4.160.0060.00916.29
7.4.150.0140.01117.40
7.4.140.0050.01217.86
7.4.130.0050.01216.50
7.4.120.0030.01416.57
7.4.110.0120.00616.57
7.4.100.0100.00716.59
7.4.90.0110.00716.47
7.4.80.0110.00919.39
7.4.70.0090.00916.75
7.4.60.0060.01016.59
7.4.50.0000.00816.62
7.4.40.0130.01016.71
7.4.30.0120.00616.66
7.4.00.0030.01314.85
7.3.330.0030.00313.31
7.3.320.0000.01413.23
7.3.310.0000.00716.26
7.3.300.0000.00716.38
7.3.290.0050.00216.40
7.3.280.0110.00616.35
7.3.270.0090.00917.40
7.3.260.0170.00016.53
7.3.250.0110.00916.55
7.3.240.0090.00916.43
7.3.230.0060.01916.39
7.3.210.0110.00416.36
7.3.200.0070.01419.39
7.3.190.0100.00916.41
7.3.180.0150.00016.59
7.3.170.0090.01516.49
7.3.160.0110.00516.39
7.3.120.0120.00614.91
7.3.110.0100.00614.91
7.3.100.0080.00815.02
7.3.90.0030.01014.88
7.3.80.0060.00914.86
7.3.70.0060.00914.82
7.3.60.0040.00814.75
7.3.50.0060.00614.81
7.3.40.0100.00714.55
7.3.30.0070.00714.81
7.3.20.0030.01416.89
7.3.10.0130.00016.55
7.3.00.0040.00716.74
7.2.330.0080.01216.87
7.2.320.0200.00016.52
7.2.310.0150.00816.49
7.2.300.0070.01716.79
7.2.290.0080.02016.86
7.2.250.0100.01014.93
7.2.240.0140.00615.27
7.2.230.0060.00515.28
7.2.220.0000.01115.08
7.2.210.0030.01014.75
7.2.200.0100.00714.88
7.2.190.0060.00915.13
7.2.180.0120.00315.21
7.2.170.0110.00714.98
7.2.60.0110.00616.46
7.2.00.0030.01219.48
7.1.330.0060.01015.73
7.1.320.0030.00615.98
7.1.310.0060.00615.94
7.1.300.0000.01015.97
7.1.290.0030.00915.43
7.1.280.0060.00615.74
7.1.270.0000.01715.80
7.1.260.0030.01015.89
7.1.200.0090.00315.49
7.1.100.0080.00318.15
7.1.70.0070.01017.38
7.1.60.0030.01719.46
7.1.50.0100.01016.99
7.1.00.0130.06022.33
7.0.200.0030.00616.47
7.0.140.0000.03722.04
7.0.60.0130.04720.05
7.0.50.0030.07717.91
7.0.40.0030.06320.04
7.0.30.0200.08320.06
7.0.20.0470.03720.12
7.0.10.0270.08320.16
7.0.00.0030.04720.08
5.6.280.0030.07021.13
5.6.210.0100.08020.67
5.6.200.0030.07018.29
5.6.190.0100.03720.45
5.6.180.0200.07720.50
5.6.170.0330.03720.53
5.6.160.0030.05320.71
5.6.150.0070.03718.18
5.6.140.0030.06718.18
5.6.130.0030.04318.24
5.6.120.0000.05021.13
5.6.110.0070.06720.99
5.6.100.0070.04020.98
5.6.90.0200.07720.98
5.6.80.0030.06320.51
5.6.70.0270.07020.37
5.5.350.0130.07320.33
5.5.340.0000.04717.95
5.5.330.0000.04320.23
5.5.320.0030.05720.27
5.5.310.0270.06320.24
5.5.300.0130.06717.95
5.5.290.0170.07017.93
5.5.280.0030.04320.89
5.5.270.0070.04020.69
5.5.260.0100.03320.77
5.5.250.0130.08020.69
5.5.240.0100.08020.25
5.4.450.0500.05719.55
5.4.440.0800.05319.61
5.4.430.0100.05319.47
5.4.420.0630.05719.58
5.4.410.0000.06319.47
5.4.400.0100.08318.85
5.4.390.0330.04318.79
5.4.380.0230.04718.52
5.4.370.0200.06018.59
5.4.360.0200.05318.75
5.4.350.0170.06318.59
5.4.340.0130.05718.59
5.4.320.0170.08018.73
5.4.310.0270.05018.75
5.4.300.0170.06018.75
5.4.290.0230.06718.75
5.4.280.0130.08018.57
5.4.270.0200.06318.59
5.4.260.0200.05318.50
5.4.250.0230.06318.75
5.4.240.0300.04718.78
5.4.230.0170.05718.71
5.4.220.0270.06718.77
5.4.210.0100.05718.77
5.4.200.0130.05316.71
5.4.190.0170.05318.80
5.4.180.0230.05718.46
5.4.170.0170.08018.60
5.4.160.0200.05718.76
5.4.150.0130.07318.48
5.4.140.0230.05016.45
5.4.130.0070.06316.30
5.4.120.0200.05016.30
5.4.110.0200.06316.24
5.4.100.0200.06716.44
5.4.90.0170.07716.30
5.4.80.0170.06716.20
5.4.70.0230.06716.40
5.4.60.0270.04316.30
5.4.50.0100.05316.27
5.4.40.0170.05716.28
5.4.30.0330.04016.25
5.4.20.0230.04716.40
5.4.10.0230.04316.38
5.4.00.0130.05315.72
5.3.290.0230.04714.71
5.3.280.0200.05014.62
5.3.270.0170.06014.59
5.3.260.0230.05714.65
5.3.250.0070.07314.80
5.3.240.0230.05014.71
5.3.230.0330.06014.69
5.3.220.0330.06014.59
5.3.210.0200.05314.64
5.3.200.0100.08014.67
5.3.190.0200.07014.66
5.3.180.0200.05314.61
5.3.170.0170.05714.66
5.3.160.0100.06014.61
5.3.150.0300.04014.66
5.3.140.0200.05014.72
5.3.130.0230.05314.52
5.3.120.0130.06014.82
5.3.110.0170.05714.69
5.3.100.0270.04314.09
5.3.90.0170.05714.10
5.3.80.0170.06013.99
5.3.70.0100.06314.05
5.3.60.0170.05714.11
5.3.50.0230.04714.00
5.3.40.0170.05014.05
5.3.30.0330.03714.01
5.3.20.0070.06713.77
5.3.10.0330.05313.70
5.3.00.0170.07013.63
5.2.170.0200.04311.10
5.2.160.0130.04011.18
5.2.150.0200.03711.14
5.2.140.0170.04711.11
5.2.130.0170.04711.23
5.2.120.0100.05011.05
5.2.110.0200.03711.03
5.2.100.0130.04011.09
5.2.90.0170.04311.09
5.2.80.0170.05011.07
5.2.70.0230.03711.14
5.2.60.0270.04711.01
5.2.50.0130.04711.05
5.2.40.0130.05010.93
5.2.30.0100.05710.97
5.2.20.0230.04310.93
5.2.10.0030.06010.97
5.2.00.0070.06010.74
5.1.60.0200.0409.96
5.1.50.0070.05010.09
5.1.40.0100.04710.05
5.1.30.0100.04010.41
5.1.20.0070.05010.45
5.1.10.0070.04310.04
5.1.00.0130.04710.04
5.0.50.0100.0378.62
5.0.40.0130.0308.46
5.0.30.0100.0538.34
5.0.20.0070.0308.37
5.0.10.0130.0338.14
5.0.00.0030.0438.28
4.4.90.0030.0235.88
4.4.80.0100.0235.91
4.4.70.0030.0235.86
4.4.60.0030.0235.82
4.4.50.0130.0235.91
4.4.40.0030.0375.88
4.4.30.0000.0275.82
4.4.20.0070.0235.95
4.4.10.0100.0205.96
4.4.00.0030.0375.90
4.3.110.0100.0175.88
4.3.100.0030.0235.74
4.3.90.0000.0275.86
4.3.80.0070.0335.77
4.3.70.0100.0175.79
4.3.60.0000.0305.77
4.3.50.0000.0335.79
4.3.40.0000.0405.82
4.3.30.0030.0234.64
4.3.20.0030.0234.52
4.3.10.0030.0304.50
4.3.00.0130.0206.91

preferences:
33.48 ms | 400 KiB | 5 Q