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

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.0140.00718.43
8.3.50.0120.00617.95
8.3.40.0120.00318.66
8.3.30.0030.01018.54
8.3.20.0040.00420.21
8.3.10.0080.00020.40
8.3.00.0090.00018.68
8.2.180.0110.00716.75
8.2.170.0120.00322.96
8.2.160.0070.01020.60
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0090.00019.23
8.2.120.0040.00426.35
8.2.110.0030.00620.53
8.2.100.0090.00317.72
8.2.90.0050.00319.17
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0050.00317.92
8.2.50.0000.00818.09
8.2.40.0030.00522.20
8.2.30.0000.00719.32
8.2.20.0070.00017.61
8.2.10.0030.00519.78
8.2.00.0040.00417.93
8.1.280.0070.01425.92
8.1.270.0040.00423.66
8.1.260.0030.00528.09
8.1.250.0000.00828.09
8.1.240.0000.00922.01
8.1.230.0090.00317.42
8.1.220.0040.00417.76
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0030.00617.23
8.1.180.0040.00418.10
8.1.170.0000.00818.42
8.1.160.0040.00420.88
8.1.150.0080.00018.93
8.1.140.0070.00019.63
8.1.130.0040.00417.77
8.1.120.0040.00417.38
8.1.110.0000.00717.37
8.1.100.0080.00017.45
8.1.90.0030.00517.50
8.1.80.0030.00517.36
8.1.70.0030.00317.45
8.1.60.0000.00817.54
8.1.50.0050.00517.53
8.1.40.0030.00517.44
8.1.30.0080.00017.71
8.1.20.0000.00817.65
8.1.10.0030.00617.49
8.1.00.0060.00317.34
8.0.300.0070.00018.77
8.0.290.0070.00016.63
8.0.280.0050.00318.44
8.0.270.0040.00417.30
8.0.260.0000.00617.32
8.0.250.0070.00016.99
8.0.240.0000.00716.95
8.0.230.0000.00716.98
8.0.220.0040.00416.90
8.0.210.0000.00716.82
8.0.200.0030.00316.95
8.0.190.0040.00416.82
8.0.180.0000.00916.95
8.0.170.0030.00516.94
8.0.160.0040.00416.91
8.0.150.0000.00716.82
8.0.140.0040.00416.81
8.0.130.0060.00013.36
8.0.120.0020.00516.88
8.0.110.0050.00316.99
8.0.100.0040.00416.88
8.0.90.0000.00816.84
8.0.80.0070.01016.85
8.0.70.0030.00516.93
8.0.60.0050.00316.96
8.0.50.0070.00016.86
8.0.30.0110.00617.17
8.0.20.0100.00717.40
8.0.10.0000.00716.88
8.0.00.0130.00716.84
7.4.330.0050.00015.08
7.4.320.0050.00216.37
7.4.300.0030.00316.45
7.4.290.0070.00016.50
7.4.280.0070.00016.55
7.4.270.0030.00316.54
7.4.260.0040.00416.48
7.4.250.0060.00316.52
7.4.240.0030.00316.61
7.4.230.0000.00716.67
7.4.220.0100.01016.70
7.4.210.0090.00616.54
7.4.200.0000.00716.41
7.4.160.0060.00916.32
7.4.150.0060.01217.40
7.4.140.0050.01417.86
7.4.130.0130.01016.52
7.4.120.0100.00716.51
7.4.110.0120.00616.47
7.4.100.0130.00416.50
7.4.90.0140.00316.55
7.4.80.0130.01019.39
7.4.70.0100.00616.68
7.4.60.0120.00416.39
7.4.50.0110.00416.39
7.4.40.0130.00316.72
7.4.30.0120.00316.70
7.4.00.0040.01315.08
7.3.330.0030.00313.35
7.3.320.0000.00513.23
7.3.310.0040.00416.25
7.3.300.0030.00316.23
7.3.290.0080.00616.38
7.3.280.0080.01016.37
7.3.270.0130.00617.40
7.3.260.0070.01016.54
7.3.250.0100.00816.52
7.3.240.0100.00816.40
7.3.230.0090.00616.39
7.3.210.0070.01016.59
7.3.200.0070.01416.59
7.3.190.0030.01316.35
7.3.180.0030.01316.34
7.3.170.0070.01116.45
7.3.160.0080.01116.57
7.3.120.0030.01615.06
7.3.110.0100.01015.08
7.3.100.0110.00415.03
7.3.90.0030.01415.00
7.3.80.0070.00714.77
7.3.70.0150.00314.82
7.3.60.0090.00414.83
7.3.50.0110.00714.97
7.3.40.0070.00714.81
7.3.30.0030.00614.93
7.3.20.0130.00316.67
7.3.10.0070.00716.56
7.3.00.0100.00316.72
7.2.330.0080.01216.68
7.2.320.0110.00816.74
7.2.310.0130.00716.69
7.2.300.0060.01316.77
7.2.290.0120.00816.86
7.2.250.0090.00615.00
7.2.240.0120.00615.29
7.2.230.0040.00815.19
7.2.220.0130.00315.20
7.2.210.0080.00615.22
7.2.200.0050.00514.81
7.2.190.0000.01514.84
7.2.180.0030.01014.90
7.2.170.0040.01115.10
7.2.110.0030.01016.52
7.2.60.0120.00316.77
7.2.00.0000.01019.39
7.1.330.0060.00815.64
7.1.320.0030.01015.75
7.1.310.0100.00715.77
7.1.300.0100.00315.74
7.1.290.0090.00615.73
7.1.280.0060.00315.77
7.1.270.0000.01515.89
7.1.260.0030.00615.78
7.1.200.0060.00615.96
7.1.100.0050.00517.99
7.1.70.0030.00717.23
7.1.60.0090.01619.27
7.1.50.0070.01417.02
7.1.00.0170.06022.57
7.0.200.0310.00615.16
7.0.60.0030.09021.73
7.0.50.0100.03317.88
7.0.40.0000.07320.13
7.0.30.0300.07020.07
7.0.20.0270.05320.17
7.0.10.0070.09020.21
7.0.00.0100.08020.19
5.6.280.0000.07321.13
5.6.210.0030.08720.67
5.6.200.0030.04318.16
5.6.190.0030.09020.77
5.6.180.0230.05020.34
5.6.170.0270.03320.56
5.6.160.0130.03720.45
5.6.150.0030.08318.14
5.6.140.0070.07318.26
5.6.130.0000.05318.21
5.6.120.0100.08021.13
5.6.110.0200.07721.09
5.6.100.0030.06021.00
5.6.90.0000.09021.00
5.6.80.0070.05720.52
5.5.350.4100.04020.53
5.5.340.0070.07717.96
5.5.330.0100.05320.27
5.5.320.0300.05720.31
5.5.310.0330.06320.34
5.5.300.0070.08017.97
5.5.290.0070.08017.96
5.5.280.0070.08320.87
5.5.270.0130.07720.77
5.5.260.0070.07320.64
5.5.250.0030.08720.61
5.5.240.0270.06720.19

preferences:
57.09 ms | 401 KiB | 5 Q