3v4l.org

run code in 300+ PHP versions simultaneously
<?hh function fibonacci($n){ /* * Notice that in PHP, we do not have to declare our variables, nor must we * declare their types. Also see how variables in PHP are prefaced with the * dollar sign. Other than that, this is identical to the C version of this function. */ $a = 0; $b = 1; for ($i = 0; $i < $n; $i++){ printf("%d\n",$a); $sum = $a+$b; $a = $b; $b = $sum; } } fibonacci(1000);

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.0070.00716.75
8.3.50.0070.01122.05
8.3.40.0100.00718.71
8.3.30.0070.00718.96
8.3.20.0040.00420.04
8.3.10.0070.00023.53
8.3.00.0000.00920.96
8.2.180.0150.00316.32
8.2.170.0070.01322.96
8.2.160.0070.00720.34
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00019.38
8.2.110.0160.00322.16
8.2.100.0110.00020.64
8.2.90.0000.00719.23
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0060.00317.93
8.2.50.0060.00318.07
8.2.40.0040.00418.22
8.2.30.0020.00518.11
8.2.20.0000.00917.59
8.2.10.0080.00017.99
8.2.00.0040.00419.34
8.1.280.0100.00725.92
8.1.270.0030.00523.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.08
8.1.230.0000.01119.08
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0060.00317.10
8.1.180.0070.00018.10
8.1.170.0040.00418.39
8.1.160.0040.00421.99
8.1.150.0000.00718.47
8.1.140.0040.00417.38
8.1.130.0070.00017.73
8.1.120.0050.00217.23
8.1.110.0040.00417.21
8.1.100.0000.00717.27
8.1.90.0050.00317.17
8.1.80.0000.00817.27
8.1.70.0000.00717.20
8.1.60.0030.00617.45
8.1.50.0040.00417.30
8.1.40.0070.00017.37
8.1.30.0000.00817.53
8.1.20.0050.00317.51
8.1.10.0000.00717.48
8.1.00.0000.00717.28
8.0.300.0030.00318.77
8.0.290.0030.00616.75
8.0.280.0000.00818.38
8.0.270.0050.00317.25
8.0.260.0040.00417.09
8.0.250.0070.00016.72
8.0.240.0070.00016.83
8.0.230.0000.00716.76
8.0.220.0000.00716.69
8.0.210.0000.00716.75
8.0.200.0000.00716.69
8.0.190.0040.00416.69
8.0.180.0000.00716.76
8.0.170.0000.00716.76
8.0.160.0070.00016.61
8.0.150.0040.00416.58
8.0.140.0000.00716.71
8.0.130.0030.00313.32
8.0.120.0000.00716.76
8.0.110.0000.00816.66
8.0.100.0040.00416.64
8.0.90.0040.00416.64
8.0.80.0070.01516.74
8.0.70.0000.00716.72
8.0.60.0000.00716.57
8.0.50.0040.00416.65
8.0.30.0120.00717.06
8.0.20.0120.00917.40
8.0.10.0050.00216.83
8.0.00.0120.00716.55
7.4.330.0050.00315.00
7.4.320.0030.00316.39
7.4.300.0060.00016.46
7.4.290.0000.00616.37
7.4.280.0000.00716.45
7.4.270.0070.00016.26
7.4.260.0030.00516.34
7.4.250.0000.00816.19
7.4.240.0060.00216.35
7.4.230.0000.00716.22
7.4.220.0110.00716.40
7.4.210.0120.00316.32
7.4.200.0040.00316.34
7.4.160.0160.00016.34
7.4.150.0090.00917.40
7.4.140.0080.00917.86
7.4.130.0080.01216.27
7.4.120.0060.01116.40
7.4.110.0100.00716.43
7.4.100.0130.00316.36
7.4.90.0100.00716.40
7.4.80.0120.00919.39
7.4.70.0130.00216.27
7.4.60.0100.01016.30
7.4.50.0040.00416.32
7.4.40.0120.00916.30
7.4.30.0110.00416.54
7.3.330.0020.00213.21
7.3.320.0030.00312.95
7.3.310.0000.00716.22
7.3.300.0000.00715.98
7.3.290.0050.00916.18
7.3.280.0080.01016.09
7.3.270.0090.00617.40
7.3.260.0180.00616.03
7.3.250.0090.00716.25
7.3.240.0080.01216.47
7.3.230.0130.00416.39
7.3.210.0130.00716.13
7.3.200.0060.01319.39
7.3.190.0100.01016.49
7.3.180.0090.00616.41
7.3.170.0000.01616.27
7.3.160.0090.00616.32
7.2.330.0060.01416.50
7.2.320.0160.00016.36
7.2.310.0150.00716.43
7.2.300.0100.00616.32
7.2.290.0030.01316.34
5.4.320.0050.04012.45
5.4.310.0070.04412.45
5.4.300.0060.03612.45
5.4.290.0080.04612.45
5.4.280.0050.03512.35
5.4.270.0060.03512.34
5.4.260.0050.03812.34
5.4.250.0090.03312.34
5.4.240.0060.03512.34
5.4.230.0100.06912.34
5.4.220.0050.03712.34
5.4.210.0060.03412.34
5.4.200.0040.03912.34
5.4.190.0110.04012.33
5.4.180.0050.04312.33
5.4.170.0040.03712.35
5.4.160.0080.03512.34
5.4.150.0060.03712.34
5.4.140.0060.03612.02
5.4.130.0060.03512.01
5.4.120.0070.03711.97
5.4.110.0050.04611.96
5.4.100.0050.03611.96
5.4.90.0040.03811.96
5.4.80.0080.04011.96
5.4.70.0050.03511.96
5.4.60.0050.03511.96
5.4.50.0050.03611.96
5.4.40.0040.03611.95
5.4.30.0050.03611.95
5.4.20.0080.03411.95
5.4.10.0060.03311.95
5.4.00.0060.04311.43
5.3.290.0060.04012.80
5.3.280.0040.03912.71
5.3.270.0060.04612.73
5.3.260.0070.04812.72
5.3.250.0040.04512.72
5.3.240.0060.04512.72
5.3.230.0100.04012.71
5.3.220.0060.03712.68
5.3.210.0060.04012.68
5.3.200.0100.03312.68
5.3.190.0070.03612.68
5.3.180.0080.03612.67
5.3.170.0040.03712.67
5.3.160.0060.04112.68
5.3.150.0040.03812.68
5.3.140.0050.04312.66
5.3.130.0070.03712.66
5.3.120.0080.04212.65
5.3.110.0040.04112.66
5.3.100.0070.03612.12
5.3.90.0060.03712.09
5.3.80.0030.03912.07
5.3.70.0090.03312.08
5.3.60.0080.03612.06
5.3.50.0080.03212.00
5.3.40.0060.04312.00
5.3.30.0050.03511.94
5.3.20.0030.03711.72
5.3.10.0070.03311.69
5.3.00.0030.03711.67

preferences:
42.51 ms | 400 KiB | 5 Q