3v4l.org

run code in 300+ PHP versions simultaneously
<?phpclass Factoriel {public function calculate() { if(func_num_args() != 1) throw new Exception ("Invalid arguments count for method calculate!"); if(($n = (int)func_get_arg(0)) <= 0) throw new Exception ("Invalid argument supplied for method calculate!"); $result = 1; foreach(range(1, $n) as $current) $result = $this->multiply ($result, $current); return $result;}private function multiply($left, $right) { return bcmul("$left", "$right"); }}$factoriel = new Factoriel();echo $factoriel->calculate(1500);?>

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.0120.00316.38
8.3.50.0070.00719.77
8.3.40.0030.01418.59
8.3.30.0100.00318.73
8.3.20.0080.00020.04
8.3.10.0040.00421.66
8.3.00.0000.00717.68
8.2.180.0130.00916.50
8.2.170.0070.01122.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.03
8.2.110.0040.00422.30
8.2.100.0090.00317.78
8.2.90.0080.00017.91
8.2.80.0080.00019.16
8.2.70.0050.00317.63
8.2.60.0080.00017.88
8.2.50.0050.00318.10
8.2.40.0000.00717.78
8.2.30.0040.00417.93
8.2.20.0030.00617.65
8.2.10.0070.00018.02
8.2.00.0040.00417.54
8.1.280.0180.00325.92
8.1.270.0050.00323.84
8.1.260.0070.00026.35
8.1.250.0050.00228.09
8.1.240.0090.00922.19
8.1.230.0040.00820.70
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.11
8.1.190.0040.00417.11
8.1.180.0040.00418.10
8.1.170.0030.00518.42
8.1.160.0000.00821.80
8.1.150.0000.00718.61
8.1.140.0040.00417.21
8.1.130.0000.00717.65
8.1.120.0040.00417.42
8.1.110.0070.00017.19
8.1.100.0000.00717.20
8.1.90.0000.00717.32
8.1.80.0000.00717.28
8.1.70.0000.00817.28
8.1.60.0040.00417.44
8.1.50.0030.00517.28
8.1.40.0000.00717.22
8.1.30.0000.00817.46
8.1.20.0050.00317.47
8.1.10.0040.00417.46
8.1.00.0000.00817.27
8.0.300.0050.00219.96
8.0.290.0030.00616.63
8.0.280.0030.00318.36
8.0.270.0040.00417.19
8.0.260.0030.00317.24
8.0.250.0030.00316.71
8.0.240.0100.00016.82
8.0.230.0030.00616.71
8.0.220.0000.00716.79
8.0.210.0000.01016.76
8.0.200.0000.00716.70
8.0.190.0040.00416.74
8.0.180.0050.00316.79
8.0.170.0000.00816.79
8.0.160.0000.00716.70
8.0.150.0030.00316.58
8.0.140.0060.00316.64
8.0.130.0000.00913.34
8.0.120.0040.00416.73
8.0.110.0040.00416.64
8.0.100.0030.00516.72
8.0.90.0000.00716.80
8.0.80.0030.01616.75
8.0.70.0040.00416.81
8.0.60.0000.00716.80
8.0.50.0050.00216.71
8.0.30.0120.00617.21
8.0.20.0090.00917.40
8.0.10.0000.00716.86
8.0.00.0120.00616.75
7.4.330.0020.00215.00
7.4.320.0030.00316.29
7.4.300.0030.00316.44
7.4.290.0000.00716.36
7.4.280.0000.00716.45
7.4.270.0000.00716.45
7.4.260.0070.00016.27
7.4.250.0030.00516.35
7.4.240.0000.00716.50
7.4.230.0000.00716.46
7.4.220.0120.00616.39
7.4.210.0070.00716.32
7.4.200.0070.00016.21
7.4.160.0090.00916.42
7.4.150.0100.01017.40
7.4.140.0100.00817.86
7.4.130.0130.00716.49
7.4.120.0130.00616.47
7.4.110.0110.00616.55
7.4.100.0070.01016.43
7.4.90.0040.01416.36
7.4.80.0090.00919.39
7.4.70.0080.00816.44
7.4.60.0110.00716.34
7.4.50.0050.00016.22
7.4.40.0140.01016.39
7.4.30.0160.00016.30
7.3.330.0000.00613.01
7.3.320.0050.00013.09
7.3.310.0000.00716.27
7.3.300.0060.00015.98
7.3.290.0030.01016.17
7.3.280.0130.00416.12
7.3.270.0100.00717.40
7.3.260.0070.01316.27
7.3.250.0130.00616.22
7.3.240.0090.01316.29
7.3.230.0120.00416.50
7.3.210.0140.00916.37
7.3.200.0120.00919.39
7.3.190.0170.00316.13
7.3.180.0070.01016.27
7.3.170.0100.00616.27
7.3.160.0130.00316.13
7.2.330.0060.01616.52
7.2.320.0070.01116.58
7.2.310.0090.00616.44
7.2.300.0060.01016.53
7.2.290.0120.01016.55
5.4.310.0230.04318.95
5.4.300.0230.05018.85
5.4.290.0170.07018.98
5.4.280.0270.04318.99
5.4.270.0230.07019.34
5.4.260.0330.06719.22
5.4.250.0300.06719.13
5.4.240.0170.08019.32
5.4.230.0270.05019.13
5.4.220.0130.04719.20
5.4.210.0170.06318.93
5.4.200.0130.07018.98
5.4.190.0270.04318.97
5.4.180.0200.04719.05
5.4.170.0170.03718.98
5.4.160.0170.03319.06
5.4.150.0170.03319.06
5.4.140.0130.04016.52
5.4.130.0100.04016.53
5.4.120.0170.03316.35
5.4.110.0130.03316.55
5.4.100.0170.03316.56
5.4.90.0170.03316.54
5.4.80.0130.04016.55
5.4.70.0170.03316.50
5.4.60.0100.03716.43
5.4.50.0130.03316.52
5.4.40.0200.03316.42
5.4.30.0170.03316.42
5.4.20.0130.03316.25
5.4.10.0070.04016.37
5.4.00.0200.02715.79
5.3.290.0200.05314.59
5.3.280.0270.07014.43
5.3.270.0070.04314.55
5.3.260.0130.03714.43
5.3.250.0130.04314.51
5.3.240.0100.04014.46
5.3.230.0170.03314.54
5.3.220.0200.03014.61
5.3.210.0100.04014.59
5.3.200.0200.03014.46
5.3.190.0100.04014.41
5.3.180.0200.06014.39
5.3.170.0130.03714.49
5.3.160.0130.03714.39
5.3.150.0170.03314.49
5.3.140.0170.03314.48
5.3.130.0130.03714.52
5.3.120.0070.04314.45
5.3.110.0170.03314.59
5.3.100.0130.03713.98
5.3.90.0230.03314.06
5.3.80.0130.03713.99
5.3.70.0100.04313.86
5.3.60.0230.03013.98
5.3.50.0130.03314.03
5.3.40.0100.04013.78
5.3.30.0070.04713.85
5.3.20.0130.03313.71
5.3.10.0130.03713.60
5.3.00.0370.05013.58

preferences:
63.72 ms | 400 KiB | 5 Q