3v4l.org

run code in 300+ PHP versions simultaneously
<?php function couldBeDividedBy5($number) { $last_digit = substr($number, -1); return ($last_digit == '5' || $last_digit == '0'); } function couldBeDividedBy3($number) { if (strlen($number) > 1) { return couldBeDividedBy3(array_sum(str_split($number))); } else { return ($number == '3' || $number == '6' || $number == '9' || $number == '0'); } } function fizzbuzz($from, $to) { if ($from > $to) { return; } if (couldBeDividedBy5($from) || couldBeDividedBy3($from)) { if (couldBeDividedBy3($from)) { echo 'Fizz'; } if (couldBeDividedBy5($from)) { echo 'Buzz'; } } else echo $from; echo PHP_EOL; return fizzbuzz($from + 1, $to); } fizzbuzz(0, 20);

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.0060.00916.58
8.3.60.0110.00316.38
8.3.50.0140.00723.02
8.3.40.0120.00318.63
8.3.30.0070.00719.04
8.3.20.0080.00020.29
8.3.10.0060.00320.45
8.3.00.0040.00420.95
8.2.190.0070.00716.88
8.2.180.0110.01118.42
8.2.170.0070.00722.96
8.2.160.0070.01320.45
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0110.00726.16
8.2.120.0070.00318.89
8.2.110.0090.00022.31
8.2.100.0080.00417.84
8.2.90.0040.00419.21
8.2.80.0040.00418.05
8.2.70.0040.00417.63
8.2.60.0060.00318.05
8.2.50.0050.00518.07
8.2.40.0060.00318.00
8.2.30.0080.00019.32
8.2.20.0040.00417.74
8.2.10.0000.00717.93
8.2.00.0000.00817.69
8.1.280.0120.00625.92
8.1.270.0040.00422.14
8.1.260.0180.00026.35
8.1.250.0090.00928.09
8.1.240.0040.00419.16
8.1.230.0040.00720.89
8.1.220.0000.00818.77
8.1.210.0030.00619.03
8.1.200.0000.01017.35
8.1.190.0000.00717.53
8.1.180.0000.00818.10
8.1.170.0030.00618.57
8.1.160.0040.00418.88
8.1.150.0070.00018.82
8.1.140.0050.00317.39
8.1.130.0000.00717.80
8.1.120.0000.00717.38
8.1.110.0040.00417.47
8.1.100.0040.00417.48
8.1.90.0040.00417.37
8.1.80.0000.00717.31
8.1.70.0030.00317.45
8.1.60.0000.00817.48
8.1.50.0000.00817.57
8.1.40.0120.00017.52
8.1.30.0030.00617.66
8.1.20.0000.00817.57
8.1.10.0040.00417.49
8.1.00.0040.00417.46
8.0.300.0000.00720.08
8.0.290.0050.00217.16
8.0.280.0070.00018.45
8.0.270.0000.00717.27
8.0.260.0040.00417.26
8.0.250.0030.00316.84
8.0.240.0000.00717.00
8.0.230.0070.00016.94
8.0.220.0030.00316.81
8.0.210.0000.00816.90
8.0.200.0030.00316.88
8.0.190.0040.00416.95
8.0.180.0040.00416.95
8.0.170.0070.00016.83
8.0.160.0040.00416.92
8.0.150.0000.00716.84
8.0.140.0040.00416.75
8.0.130.0080.00013.30
8.0.120.0000.00816.89
8.0.110.0000.00716.95
8.0.100.0030.00516.95
8.0.90.0040.00416.86
8.0.80.0040.01216.94
8.0.70.0000.00716.75
8.0.60.0000.00716.77
8.0.50.0040.00416.85
8.0.30.0120.00717.07
8.0.20.0050.01417.40
8.0.10.0070.00017.09
8.0.00.0100.00816.98
7.4.330.0000.00515.03
7.4.320.0030.00316.50
7.4.300.0030.00316.55
7.4.290.0000.00716.61
7.4.280.0040.00416.50
7.4.270.0080.00016.59
7.4.260.0040.00416.65
7.4.250.0000.00816.54
7.4.240.0040.00416.54
7.4.230.0040.00416.57
7.4.220.0070.01016.41
7.4.210.0100.01016.64
7.4.200.0000.00716.61
7.4.160.0140.00716.43
7.4.150.0040.01317.40
7.4.140.0090.00917.86
7.4.130.0150.00116.54
7.4.120.0130.00716.53
7.4.110.0100.01316.65
7.4.100.0120.00616.60
7.4.90.0140.00716.52
7.4.80.0120.00619.39
7.4.70.0090.00916.64
7.4.60.0090.01216.43
7.4.50.0100.00016.53
7.4.40.0120.01116.40
7.4.30.0070.01016.44
7.4.00.0030.01214.90
7.3.330.0030.00313.30
7.3.320.0000.00613.31
7.3.310.0030.00316.37
7.3.300.0030.00316.26
7.3.290.0050.01316.37
7.3.280.0050.01116.36
7.3.270.0030.01317.40
7.3.260.0060.01116.67
7.3.250.0120.00716.36
7.3.240.0100.00716.26
7.3.230.0040.01216.39
7.3.210.0070.01016.59
7.3.200.0140.00319.39
7.3.190.0090.00916.43
7.3.180.0040.01116.66
7.3.170.0130.00316.46
7.3.160.0100.00516.37
7.2.330.0170.00316.80
7.2.320.0100.00716.73
7.2.310.0120.00916.58
7.2.300.0070.01316.36
7.2.290.0100.01316.54
7.2.60.0030.00916.56
7.1.200.0060.00915.79
7.1.70.0060.01017.26
7.1.60.0000.01117.06
7.1.50.0070.01416.87
7.1.00.0070.07322.31
7.0.200.0000.01216.53
7.0.140.0000.07321.95
7.0.60.0170.07720.05
7.0.50.0070.08018.00
7.0.40.0100.08320.30
7.0.30.0330.06020.10
7.0.20.0270.04020.25
7.0.10.0070.05020.22
7.0.00.0070.08320.29
5.6.280.0000.07720.79
5.6.210.0200.06020.65
5.6.200.0030.08318.25
5.6.190.0000.04720.67
5.6.180.4100.03320.45
5.6.170.0330.07720.44
5.6.160.0070.05320.55
5.6.150.0130.07018.21
5.6.140.0070.04718.15
5.6.130.0030.08718.18
5.6.120.0100.08320.98
5.6.110.0070.07720.96
5.6.100.0130.07721.00
5.6.90.0100.08321.10
5.6.80.0030.08320.39
5.6.70.3830.04720.51
5.5.350.0070.07720.41
5.5.340.0100.07718.09
5.5.330.0030.05320.45
5.5.320.0300.07320.40
5.5.310.0230.08020.35
5.5.300.0030.04017.94
5.5.290.0030.08017.97
5.5.280.0130.08020.98
5.5.270.0070.05320.90
5.5.260.0070.04720.68
5.5.250.0070.07720.64
5.5.240.0330.06720.20
5.4.450.0830.03737.91
5.4.440.0300.03737.91
5.4.430.0400.04737.90
5.4.420.0030.06019.68
5.4.410.0030.06018.73
5.4.400.0170.04718.62
5.4.390.0030.06018.81
5.4.380.0270.03718.71
5.4.370.0200.06318.76
5.4.360.0130.05018.55
5.4.350.0130.03713.78
5.4.340.0230.04013.86
5.4.320.0130.04014.27
5.4.310.0100.04314.25
5.4.300.0170.03714.21
5.4.290.0130.03714.17
5.4.280.0170.03314.25
5.4.270.0100.03714.15
5.4.260.0130.04014.35
5.4.250.0030.04714.32
5.4.240.0130.03314.09
5.4.230.0030.04714.31
5.4.220.0100.04714.23
5.4.210.0200.03014.24
5.4.200.0130.03714.12
5.4.190.0100.04014.23
5.4.180.0030.05014.31
5.4.170.0100.04314.32
5.4.160.0100.04014.12
5.4.150.0170.03314.34
5.4.140.0130.04013.72
5.4.130.0130.03713.72
5.4.120.0130.03713.93
5.4.110.0230.03013.66
5.4.100.0100.04313.96
5.4.90.0170.04313.78
5.4.80.0130.03713.93
5.4.70.0100.03713.75
5.4.60.0130.03313.76
5.4.50.0130.03713.66
5.4.40.0100.03713.66
5.4.30.0200.03313.84
5.4.20.0130.03713.64
5.4.10.0100.05313.66
5.4.00.0170.03313.21
5.3.290.0070.04714.65
5.3.280.0130.04014.75
5.3.270.0100.04014.52
5.3.260.0100.04014.65
5.3.250.0070.04714.74
5.3.240.0100.04714.74
5.3.230.0100.04314.47
5.3.220.0070.04314.56
5.3.210.0100.04314.64
5.3.200.0100.04014.51
5.3.190.0100.04014.60
5.3.180.0130.04314.71
5.3.170.0170.03714.48
5.3.160.0170.03314.51
5.3.150.0270.04314.43
5.3.140.0130.03714.59
5.3.130.0100.05014.63
5.3.120.0030.04714.58
5.3.110.0170.04014.45
5.3.100.0130.05314.09
5.3.90.0100.05013.96
5.3.80.0030.04714.00
5.3.70.0070.04014.08
5.3.60.0100.04014.07
5.3.50.0100.04013.98
5.3.40.0130.04013.95
5.3.30.0200.02713.97
5.3.20.0200.03313.81
5.3.10.0100.03713.64
5.3.00.0170.03313.73
5.2.170.0100.03711.04
5.2.160.0030.04711.23
5.2.150.0070.03711.10
5.2.140.0100.03311.22
5.2.130.0130.02711.15
5.2.120.0100.03311.04
5.2.110.0170.02711.11
5.2.100.0030.04711.25
5.2.90.0130.02711.22
5.2.80.0130.03011.18
5.2.70.0000.04311.16
5.2.60.0130.04010.95
5.2.50.0070.04711.11
5.2.40.0100.02711.08
5.2.30.0130.03011.13
5.2.20.0000.04011.12
5.2.10.0000.03710.86
5.2.00.0070.03310.70
5.1.60.0070.0279.98
5.1.50.0030.0309.94
5.1.40.0130.0309.97
5.1.30.0100.02310.49
5.1.20.0100.03010.36
5.1.10.0030.03010.09
5.1.00.0070.02710.22
5.0.50.0070.0238.51
5.0.40.0100.0138.42
5.0.30.0070.0438.23
5.0.20.0070.0208.29
5.0.10.0070.0208.09
5.0.00.0070.0308.11
4.4.90.0070.0135.87
4.4.80.0000.0235.91
4.4.70.0070.0135.89
4.4.60.0070.0135.87
4.4.50.0030.0176.01
4.4.40.0000.0305.96
4.4.30.0030.0175.91
4.4.20.0100.0106.05
4.4.10.0000.0206.05
4.4.00.0070.0235.94
4.3.110.0070.0175.88
4.3.100.0100.0135.82
4.3.90.0000.0205.79
4.3.80.0000.0335.92
4.3.70.0030.0205.79
4.3.60.0070.0175.80
4.3.50.0030.0235.78
4.3.40.0000.0305.79
4.3.30.0000.0234.70
4.3.20.0000.0204.56
4.3.10.0000.0234.63
4.3.00.0000.01737.90

preferences:
19.54 ms | 401 KiB | 5 Q