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(6);

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.130.0080.00016.61
8.3.120.0000.00920.88
8.3.110.0100.00016.68
8.3.100.0130.00316.67
8.3.90.0150.00018.54
8.3.80.0100.00018.68
8.3.70.0080.01216.49
8.3.60.0150.00018.52
8.3.50.0150.01222.07
8.3.40.0070.00718.84
8.3.30.0060.00918.96
8.3.20.0080.00020.11
8.3.10.0000.00820.66
8.3.00.0080.00019.02
8.2.250.0070.00418.51
8.2.240.0090.00017.33
8.2.230.0030.00720.94
8.2.220.0040.00424.06
8.2.210.0030.00526.77
8.2.200.0070.00318.66
8.2.190.0120.00316.58
8.2.180.0090.00618.29
8.2.170.0110.01122.96
8.2.160.0180.00020.63
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00419.61
8.2.120.0070.00026.35
8.2.110.0000.01119.63
8.2.100.0130.00017.99
8.2.90.0030.00519.38
8.2.80.0030.00517.97
8.2.70.0000.00817.88
8.2.60.0040.00418.17
8.2.50.0040.00418.09
8.2.40.0080.00022.40
8.2.30.0070.00019.56
8.2.20.0000.00717.98
8.2.10.0040.00418.32
8.2.00.0000.00818.32
8.1.300.0070.01116.82
8.1.290.0030.00618.88
8.1.280.0180.00325.92
8.1.270.0040.00424.07
8.1.260.0030.00528.09
8.1.250.0070.00028.09
8.1.240.0040.00424.20
8.1.230.0090.00321.16
8.1.220.0030.00617.91
8.1.210.0060.00318.77
8.1.200.0040.00417.48
8.1.190.0060.00317.47
8.1.180.0050.00318.10
8.1.170.0000.00818.71
8.1.160.0040.00421.03
8.1.150.0030.00519.15
8.1.140.0060.00319.80
8.1.130.0000.00717.93
8.1.120.0040.00417.64
8.1.110.0030.00517.67
8.1.100.0000.00717.70
8.1.90.0070.00017.58
8.1.80.0030.00517.53
8.1.70.0040.00417.68
8.1.60.0080.00017.82
8.1.50.0000.00817.69
8.1.40.0000.00817.68
8.1.30.0090.00017.70
8.1.20.0000.00817.82
8.1.10.0000.00817.78
8.1.00.0040.00417.65
8.0.300.0070.00018.77
8.0.290.0040.00417.00
8.0.280.0000.00718.68
8.0.270.0040.00417.48
8.0.260.0000.00717.57
8.0.250.0000.00717.15
8.0.240.0050.00217.23
8.0.230.0000.00817.18
8.0.220.0030.00317.11
8.0.210.0000.00717.02
8.0.200.0000.00717.20
8.0.190.0030.00317.14
8.0.180.0030.00717.14
8.0.170.0000.00717.02
8.0.160.0030.00616.95
8.0.150.0000.01116.97
8.0.140.0030.00317.08
8.0.130.0060.00013.61
8.0.120.0040.00417.04
8.0.110.0040.00417.07
8.0.100.0040.00417.16
8.0.90.0050.00317.16
8.0.80.0030.01316.97
8.0.70.0000.00717.01
8.0.60.0040.00416.96
8.0.50.0040.00417.14
8.0.30.0060.01117.26
8.0.20.0090.01017.41
8.0.10.0000.00817.19
8.0.00.0070.01117.05
7.4.330.0020.00215.16
7.4.320.0000.00616.73
7.4.300.0000.00616.80
7.4.290.0000.00716.73
7.4.280.0040.00416.84
7.4.270.0000.00716.80
7.4.260.0070.00016.58
7.4.250.0040.00416.64
7.4.240.0070.00016.75
7.4.230.0030.00316.91
7.4.220.0070.02016.76
7.4.210.0060.01316.71
7.4.200.0070.00016.96
7.4.160.0120.00916.77
7.4.150.0090.00917.40
7.4.140.0090.01217.86
7.4.130.0120.00716.66
7.4.120.0060.01516.65
7.4.110.0140.00716.58
7.4.100.0070.01016.81
7.4.90.0000.01816.58
7.4.80.0030.01319.39
7.4.70.0060.01316.76
7.4.60.0030.01316.91
7.4.50.0090.00616.88
7.4.40.0040.01216.64
7.4.30.0090.00616.70
7.4.00.0080.00915.11
7.3.330.0040.00413.46
7.3.320.0050.00013.54
7.3.310.0070.00016.54
7.3.300.0000.00716.46
7.3.290.0110.00716.53
7.3.280.0090.00816.60
7.3.270.0150.00317.40
7.3.260.0140.00316.65
7.3.250.0110.00816.58
7.3.240.0090.01016.73
7.3.230.0130.00416.57
7.3.210.0180.00016.64
7.3.200.0080.00816.54
7.3.190.0130.00316.65
7.3.180.0030.01316.81
7.3.170.0110.00816.68
7.3.160.0060.01816.79
7.3.120.0090.00915.15
7.3.110.0090.00915.05
7.3.100.0060.00715.14
7.3.90.0090.00515.07
7.3.80.0090.00915.21
7.3.70.0050.01215.04
7.3.60.0080.00614.99
7.3.50.0100.00514.98
7.3.40.0090.00615.01
7.3.30.0100.00315.19
7.3.20.0120.00317.12
7.3.10.0070.00816.85
7.3.00.0050.01016.86
7.2.330.0100.01416.74
7.2.320.0090.00916.96
7.2.310.0140.00516.82
7.2.300.0090.00916.64
7.2.290.0070.01016.84
7.2.250.0090.01015.33
7.2.240.0090.00914.98
7.2.230.0020.01315.47
7.2.220.0000.01315.29
7.2.210.0100.00715.20
7.2.200.0110.00015.13
7.2.190.0070.00715.23
7.2.180.0070.01015.13
7.2.170.0020.01015.14
7.2.60.0000.01716.88
7.2.00.0040.00819.64
7.1.330.0060.01015.92
7.1.320.0030.01016.08
7.1.310.0090.00316.25
7.1.300.0030.01115.97
7.1.290.0050.01015.89
7.1.280.0040.00616.08
7.1.270.0030.00915.81
7.1.260.0060.00415.81
7.1.200.0050.00815.75
7.1.100.0070.00718.16
7.1.70.0000.00717.38
7.1.60.0090.01519.27
7.1.50.0160.00317.15
7.1.00.0070.07322.68
7.0.200.0320.01015.40
7.0.60.0300.07022.03
7.0.50.0100.03318.05
7.0.40.0030.07720.43
7.0.30.0330.04720.28
7.0.20.0270.08320.21
7.0.10.0130.07320.52
7.0.00.0100.08320.35
5.6.280.0070.07020.93
5.6.210.0070.08320.73
5.6.200.0070.04018.22
5.6.190.0100.04020.63
5.6.180.0270.04020.55
5.6.170.0170.04320.48
5.6.160.0130.05320.50
5.6.150.0130.07718.28
5.6.140.0030.05318.27
5.6.130.0130.08318.29
5.6.120.0130.08321.14
5.6.110.0130.07020.98
5.6.100.0100.08321.04
5.6.90.0130.05721.00
5.6.80.0030.06020.53
5.5.350.3770.04020.30
5.5.340.0070.09018.02
5.5.330.0130.08020.35
5.5.320.0370.06720.36
5.5.310.0270.05320.28
5.5.300.0100.07718.09
5.5.290.0100.06017.99
5.5.280.0030.08020.88
5.5.270.0130.07720.78
5.5.260.0170.07320.75
5.5.250.0100.03720.50
5.5.240.0200.05720.16

preferences:
26.3 ms | 403 KiB | 5 Q