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(); echo $fizz->key(); echo $fizz->next(); echo $fizz-rewind();

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.0060.00916.63
8.3.50.0190.00222.18
8.3.40.0070.01119.02
8.3.30.0070.00719.21
8.3.20.0000.00820.34
8.3.10.0000.00821.73
8.3.00.0050.00319.51
8.2.180.0110.01118.66
8.2.170.0130.00322.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00019.35
8.2.110.0040.00721.11
8.2.100.0040.00817.75
8.2.90.0000.00719.28
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0030.00618.05
8.2.50.0060.00618.07
8.2.40.0000.00818.28
8.2.30.0040.00418.06
8.2.20.0070.00017.76
8.2.10.0030.00518.14
8.2.00.0060.00317.77
8.1.280.0110.00725.92
8.1.270.0080.01218.95
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00623.97
8.1.230.0080.00418.77
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0080.00017.48
8.1.190.0050.00317.23
8.1.180.0080.00018.10
8.1.170.0030.00620.36
8.1.160.0080.00021.95
8.1.150.0070.00018.93
8.1.140.0000.00717.38
8.1.130.0030.00517.85
8.1.120.0040.00417.46
8.1.110.0040.00417.36
8.1.100.0070.00017.34
8.1.90.0040.00417.54
8.1.80.0000.00717.36
8.1.70.0000.00717.35
8.1.60.0030.00617.61
8.1.50.0060.00317.60
8.1.40.0040.00417.53
8.1.30.0000.00817.64
8.1.20.0060.00317.59
8.1.10.0040.00417.54
8.1.00.0030.00617.45
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.42
8.0.270.0030.00317.25
8.0.260.0030.00317.19
8.0.250.0000.00717.00
8.0.240.0000.00716.93
8.0.230.0030.00417.05
8.0.220.0050.00316.87
8.0.210.0030.00316.99
8.0.200.0030.00317.05
8.0.190.0000.00717.04
8.0.180.0000.00716.87
8.0.170.0000.00816.98
8.0.160.0030.00517.08
8.0.150.0040.00416.92
8.0.140.0000.00716.94
8.0.130.0030.00313.40
8.0.120.0070.00016.98
8.0.110.0050.00316.88
8.0.100.0040.00416.93
8.0.90.0040.00416.93
8.0.80.0060.00917.00
8.0.70.0040.00416.98
8.0.60.0060.00316.99
8.0.50.0040.00416.91
8.0.30.0140.00916.96
8.0.20.0130.00517.41
8.0.10.0030.00317.06
8.0.00.0090.00816.91
7.4.330.0050.00015.15
7.4.320.0060.00016.66
7.4.300.0030.00616.46
7.4.290.0040.00416.52
7.4.280.0050.00316.55
7.4.270.0070.00016.44
7.4.260.0040.00416.47
7.4.250.0000.00716.48
7.4.240.0040.00316.53
7.4.230.0000.00716.68
7.4.220.0180.00616.57
7.4.210.0060.00916.65
7.4.200.0000.00716.72
7.4.160.0090.00616.63
7.4.150.0040.01417.40
7.4.140.0080.00917.86
7.4.130.0070.01016.56
7.4.120.0070.01116.62
7.4.110.0150.00316.70
7.4.100.0070.01616.56
7.4.90.0060.01716.41
7.4.80.0070.01119.39
7.4.70.0120.00616.62
7.4.60.0130.00316.46
7.4.50.0020.00216.61
7.4.40.0060.01116.61
7.4.30.0130.01016.51
7.4.00.0060.01014.95
7.3.330.0000.00613.30
7.3.320.0090.00613.39
7.3.310.0070.00016.49
7.3.300.0070.00016.29
7.3.290.0000.00716.30
7.3.280.0090.01016.43
7.3.270.0080.01017.40
7.3.260.0040.01516.50
7.3.250.0120.00716.42
7.3.240.0090.00916.44
7.3.230.0030.01616.48
7.3.210.0160.00016.33
7.3.200.0130.00419.39
7.3.190.0160.00016.52
7.3.180.0060.00916.48
7.3.170.0090.00916.36
7.3.160.0110.00616.38
7.3.120.0070.01014.81
7.3.110.0060.00614.80
7.3.100.0070.01015.03
7.3.90.0070.00314.89
7.3.80.0110.00314.91
7.3.70.0030.01014.92
7.3.60.0000.00914.60
7.3.50.0040.01114.77
7.3.40.0030.01014.92
7.3.30.0070.00414.87
7.3.20.0000.00916.74
7.3.10.0060.00616.70
7.3.00.0030.00616.55
7.2.330.0040.01416.43
7.2.320.0090.01516.61
7.2.310.0070.01016.63
7.2.300.0090.00916.45
7.2.290.0060.01216.52
7.2.250.0100.01015.40
7.2.240.0120.00615.35
7.2.230.0030.01214.96
7.2.220.0080.00414.83
7.2.210.0030.01114.98
7.2.200.0000.01215.04
7.2.190.0040.01215.00
7.2.180.0120.00415.05
7.2.170.0090.00015.29
7.2.00.0040.01119.57
7.1.330.0060.00615.61
7.1.320.0110.00415.89
7.1.310.0070.01015.79
7.1.300.0090.00615.87
7.1.290.0080.00015.67
7.1.280.0000.01115.69
7.1.270.0070.00715.90
7.1.260.0040.00815.74
7.1.100.0060.00618.36
7.1.70.0030.00717.22
7.1.60.0070.01819.46
7.1.50.0190.01334.56
7.1.00.0000.08022.31
7.0.200.0070.00016.89
7.0.140.0000.06322.15
7.0.60.0070.08320.04
7.0.50.0100.07717.90
7.0.40.0030.05020.14
7.0.30.0230.08020.09
7.0.20.0370.07020.24
7.0.10.0300.05320.06
7.0.00.0070.08720.30
5.6.280.0000.07720.83
5.6.210.0070.06020.61
5.6.200.0070.08318.19
5.6.190.0000.04720.55
5.6.180.0300.07320.25
5.6.170.0500.07020.71
5.6.160.0100.06720.46
5.6.150.0070.03718.18
5.6.140.0070.04018.23
5.6.130.0100.03718.14
5.6.120.0030.05021.12
5.6.110.0030.06020.98
5.6.100.0030.05021.12
5.6.90.0030.08320.97
5.6.80.0030.05320.45
5.6.70.0230.07020.49
5.5.350.0100.07320.44
5.5.340.0030.04317.96
5.5.330.0170.04020.43
5.5.320.0070.08020.30
5.5.310.0370.07320.36
5.5.300.0130.06718.01
5.5.290.0030.08018.04
5.5.280.0070.03720.65
5.5.270.0070.04020.88
5.5.260.0030.04020.69
5.5.250.0130.04720.80
5.5.240.0070.08020.17
5.4.450.0170.06019.59
5.4.440.0600.06719.59
5.4.430.1070.06719.16
5.4.420.0130.05019.61
5.4.410.0800.06019.36
5.4.400.0200.05018.87
5.4.390.0070.06318.62
5.4.380.0230.07018.60
5.4.370.0200.05318.48
5.4.360.0100.06018.50
5.4.350.0330.05318.55
5.4.340.0300.04318.48
5.4.320.0230.07318.73
5.4.310.0230.05318.57
5.4.300.0200.05318.54
5.4.290.0170.05318.70
5.4.280.0070.06318.73
5.4.270.0130.07018.77
5.4.260.0100.06018.53
5.4.250.0270.07718.73
5.4.240.0130.07718.70
5.4.230.0130.05718.77
5.4.220.0270.05018.56
5.4.210.0100.06018.79
5.4.200.0130.05716.57
5.4.190.0200.06018.72
5.4.180.0300.04718.82
5.4.170.0230.05718.55
5.4.160.0200.05718.69
5.4.150.0100.06018.71
5.4.140.0170.05716.35
5.4.130.0200.05016.22
5.4.120.0330.03716.25
5.4.110.0200.05316.29
5.4.100.0330.04716.33
5.4.90.0130.05716.34
5.4.80.0230.04716.32
5.4.70.0330.04716.20
5.4.60.0270.04016.41
5.4.50.0230.04716.16
5.4.40.0270.05016.16
5.4.30.0330.05316.41
5.4.20.0170.07316.21
5.4.10.0200.06716.25
5.4.00.0200.05715.88
5.3.290.0270.07014.64
5.3.280.0370.04014.63
5.3.270.0170.06314.58
5.3.260.0200.07314.80
5.3.250.0270.04314.71
5.3.240.0170.06014.69
5.3.230.0200.05314.63
5.3.220.0100.05714.67
5.3.210.0230.05314.60
5.3.200.0200.04714.62
5.3.190.0230.05714.60
5.3.180.0130.05714.54
5.3.170.0170.05314.69
5.3.160.0130.05714.61
5.3.150.0300.04014.68
5.3.140.0100.05314.83
5.3.130.0130.06014.52
5.3.120.0130.05714.75
5.3.110.0300.05714.65
5.3.100.0270.06314.02
5.3.90.0170.05314.07
5.3.80.0170.06314.06
5.3.70.0070.06014.01
5.3.60.0100.06014.09
5.3.50.0170.06713.94
5.3.40.0130.05313.96
5.3.30.0170.05713.99
5.3.20.0030.06313.83
5.3.10.0100.06013.67
5.3.00.0170.05713.68
5.2.170.0100.05011.11
5.2.160.0230.04711.15
5.2.150.0130.06011.31
5.2.140.0170.04011.17
5.2.130.0170.04311.06
5.2.120.0100.04011.15
5.2.110.0030.05311.27
5.2.100.0170.04011.16
5.2.90.0230.04711.25
5.2.80.0170.05711.09
5.2.70.0100.04711.13
5.2.60.0200.05311.05
5.2.50.0130.05010.96
5.2.40.0170.03310.92
5.2.30.0070.04710.94
5.2.20.0130.04010.92
5.2.10.0200.03310.87
5.2.00.0100.04310.78
5.1.60.0170.03010.13
5.1.50.0170.0409.97
5.1.40.0170.03710.09
5.1.30.0070.05010.47
5.1.20.0030.04310.42
5.1.10.0100.03710.13
5.1.00.0170.04310.09
5.0.50.0100.0378.61
5.0.40.0030.0308.40
5.0.30.0100.0538.28
5.0.20.0030.0308.19
5.0.10.0100.0238.29
5.0.00.0100.0478.36
4.4.90.0000.0305.86
4.4.80.0030.0235.89
4.4.70.0030.0235.84
4.4.60.0100.0275.81
4.4.50.0130.0205.89
4.4.40.0030.0505.81
4.4.30.0070.0275.93
4.4.20.0100.0275.98
4.4.10.0000.0375.96
4.4.00.0070.0375.89
4.3.110.0070.0305.85
4.3.100.0030.0235.74
4.3.90.0030.0235.80
4.3.80.0100.0305.80
4.3.70.0030.0335.79
4.3.60.0030.0235.77
4.3.50.0070.0205.89
4.3.40.0000.0405.79
4.3.30.0030.0234.55
4.3.20.0100.0174.64
4.3.10.0030.0204.50
4.3.00.0000.0236.91

preferences:
38.93 ms | 401 KiB | 5 Q