3v4l.org

run code in 300+ PHP versions simultaneously
<?php function echoFibonacciNumber(int $input) { if ($input < 0) { echo "Invalid input"; } if ($input === 0 || $input === 1) { $output = $input; } else { $fi = (sqrt(5) + 1) / 2; $output = floor(pow($fi, $input) / sqrt(5) + 1 / 2); } echo 'input: '.$input.', output: '.$output; } echo echoFibonacciNumber(5);

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.0160.00618.55
8.3.50.0140.00922.18
8.3.40.0070.00718.82
8.3.30.0140.00018.63
8.3.20.0040.00420.72
8.3.10.0030.00620.73
8.3.00.0040.00418.90
8.2.180.0160.00316.63
8.2.170.0180.00322.96
8.2.160.0070.01020.58
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0040.00419.49
8.2.120.0000.00726.35
8.2.110.0040.00420.77
8.2.100.0070.00417.97
8.2.90.0040.00419.30
8.2.80.0050.00317.97
8.2.70.0040.00417.88
8.2.60.0040.00418.16
8.2.50.0080.00018.09
8.2.40.0080.00022.53
8.2.30.0040.00419.51
8.2.20.0050.00217.84
8.2.10.0080.00018.16
8.2.00.0040.00418.22
8.1.280.0120.00325.92
8.1.270.0060.00324.09
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0060.00322.44
8.1.230.0000.01117.64
8.1.220.0040.00417.80
8.1.210.0040.00418.77
8.1.200.0060.00317.61
8.1.190.0040.00417.60
8.1.180.0080.00018.10
8.1.170.0000.00818.64
8.1.160.0000.00721.16
8.1.150.0020.00519.05
8.1.140.0000.00819.86
8.1.130.0000.00717.91
8.1.120.0000.00817.67
8.1.110.0070.00017.71
8.1.100.0050.00217.65
8.1.90.0000.00917.70
8.1.80.0080.00017.71
8.1.70.0000.00717.68
8.1.60.0030.00617.81
8.1.50.0040.00417.69
8.1.40.0030.00617.76
8.1.30.0040.00417.82
8.1.20.0000.00717.78
8.1.10.0050.00317.70
8.1.00.0000.00717.58
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0070.00018.67
8.0.270.0040.00417.43
8.0.260.0000.00617.48
8.0.250.0000.00717.11
8.0.240.0030.00517.09
8.0.230.0070.00017.20
8.0.220.0020.00517.17
8.0.210.0030.00317.13
8.0.200.0000.00717.18
8.0.190.0040.00417.17
8.0.180.0050.00617.11
8.0.170.0050.00217.05
8.0.160.0040.00417.00
8.0.150.0000.00817.12
8.0.140.0000.00717.03
8.0.130.0000.00613.48
8.0.120.0040.00417.11
8.0.110.0070.00017.13
8.0.100.0000.00817.28
8.0.90.0070.00016.92
8.0.80.0070.01017.11
8.0.70.0040.00417.04
8.0.60.0030.00517.04
8.0.50.0000.00717.04
8.0.30.0130.00417.21
8.0.20.0120.00717.44
8.0.10.0030.00517.33
8.0.00.0130.00817.05
7.4.330.0060.00015.10
7.4.320.0030.00316.88
7.4.300.0030.00316.74
7.4.290.0000.00816.88
7.4.280.0080.00016.73
7.4.270.0000.00716.75
7.4.260.0000.00716.70
7.4.250.0000.00816.70
7.4.240.0020.00516.77
7.4.230.0040.00416.93
7.4.220.0150.00916.83
7.4.210.0140.00316.72
7.4.200.0070.00016.94
7.4.160.0090.01316.68
7.4.150.0100.01017.40
7.4.140.0130.00517.86
7.4.130.0130.00716.75
7.4.120.0060.01216.56
7.4.110.0150.00716.72
7.4.100.0130.00616.61
7.4.90.0130.00316.74
7.4.80.0130.00319.39
7.4.70.0030.01316.70
7.4.60.0040.01316.71
7.4.50.0060.00916.83
7.4.40.0130.00516.62
7.4.30.0100.00616.59
7.4.00.0000.01615.12
7.3.330.0080.00013.51
7.3.320.0050.00013.59
7.3.310.0000.00816.55
7.3.300.0040.00416.46
7.3.290.0060.00816.57
7.3.280.0080.01216.59
7.3.270.0080.01017.40
7.3.260.0090.01316.77
7.3.250.0150.00416.58
7.3.240.0060.01316.68
7.3.230.0060.01216.61
7.3.210.0130.00616.43
7.3.200.0130.00316.52
7.3.190.0100.00716.56
7.3.180.0030.01216.77
7.3.170.0100.00716.65
7.3.160.0150.00316.69
7.2.330.0060.01216.61
7.2.320.0090.00816.68
7.2.310.0130.00616.82
7.2.300.0030.01617.02
7.2.290.0090.01216.85
7.2.60.0100.00617.13
7.2.00.0040.00819.68
7.1.200.0000.01315.90
7.1.100.0030.01018.47
7.1.70.0030.00317.54
7.1.60.0130.01319.27
7.1.50.0090.00916.92
7.1.00.0000.07722.55
7.0.200.0250.00615.19
7.0.60.0100.05321.96
7.0.50.0030.04018.10
7.0.40.0130.07720.39
7.0.30.0230.06020.39
7.0.20.0300.06020.18
7.0.10.0070.06320.41
7.0.00.0100.07320.51
5.6.280.0000.10021.09
5.6.210.0200.06720.51
5.6.200.0070.08018.29
5.6.190.0030.06020.52
5.6.180.0270.06720.77
5.6.170.0200.04020.46
5.6.160.0130.07320.50
5.6.150.0100.08318.18
5.6.140.0070.08318.21
5.6.130.0100.07718.27
5.6.120.0130.07021.04
5.6.110.0070.08320.98
5.6.100.0270.06021.14
5.6.90.0100.08320.97
5.6.80.0070.07720.40
5.5.350.4070.04020.33
5.5.340.0130.04018.02
5.5.330.0000.06720.14
5.5.320.0330.07720.42
5.5.310.0300.07320.29
5.5.300.0170.07018.09
5.5.290.0000.08718.03
5.5.280.0100.08020.88
5.5.270.0070.08720.77
5.5.260.0130.07720.87
5.5.250.0070.07020.77
5.5.240.0230.06720.16

preferences:
55.82 ms | 401 KiB | 5 Q