3v4l.org

run code in 300+ PHP versions simultaneously
<?php class 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(a);?>

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.0040.01118.43
8.3.50.0140.00718.00
8.3.40.0130.00618.73
8.3.30.0030.01218.70
8.3.20.0040.01120.33
8.3.10.0060.00321.77
8.3.00.0050.00319.72
8.2.180.0110.00716.88
8.2.170.0110.00422.96
8.2.160.0000.01420.39
8.2.150.0090.00924.18
8.2.140.0030.00624.66
8.2.130.0090.00020.89
8.2.120.0080.00026.35
8.2.110.0130.01021.07
8.2.100.0110.00017.90
8.2.90.0040.00419.23
8.2.80.0030.00517.97
8.2.70.0060.00317.63
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0040.00421.11
8.2.30.0040.00420.55
8.2.20.0040.00417.87
8.2.10.0040.00417.95
8.2.00.0050.00218.07
8.1.280.0110.00325.92
8.1.270.0130.00318.84
8.1.260.0070.00028.09
8.1.250.0100.01028.09
8.1.240.0030.00623.91
8.1.230.0040.00820.60
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0060.00317.34
8.1.190.0040.00417.63
8.1.180.0000.00818.10
8.1.170.0000.00818.39
8.1.160.0070.00020.70
8.1.150.0000.00718.93
8.1.140.0000.00819.56
8.1.130.0020.00517.64
8.1.120.0030.00317.48
8.1.110.0060.00317.49
8.1.100.0030.00517.34
8.1.90.0000.00717.53
8.1.80.0040.00417.36
8.1.70.0070.00017.42
8.1.60.0090.00017.49
8.1.50.0030.00617.56
8.1.40.0070.00717.54
8.1.30.0040.00417.60
8.1.20.0030.00617.52
8.1.10.0040.00417.57
8.1.00.0030.00617.44
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.47
8.0.270.0040.00417.14
8.0.260.0030.00317.20
8.0.250.0070.00017.10
8.0.240.0000.00617.04
8.0.230.0030.00316.98
8.0.220.0070.00016.89
8.0.210.0000.00716.91
8.0.200.0000.00817.12
8.0.190.0040.00416.99
8.0.180.0080.00017.09
8.0.170.0000.00817.00
8.0.160.0000.00817.05
8.0.150.0000.00716.90
8.0.140.0040.00416.93
8.0.130.0050.00013.42
8.0.120.0050.00316.90
8.0.110.0030.00516.97
8.0.100.0070.00016.86
8.0.90.0070.00016.83
8.0.80.0080.00816.93
8.0.70.0000.00816.97
8.0.60.0080.00016.92
8.0.50.0030.00616.91
8.0.30.0160.00117.13
8.0.20.0080.01317.41
8.0.10.0050.00217.04
8.0.00.0080.00916.73
7.4.330.0030.00316.80
7.4.320.0000.00816.52
7.4.300.0060.00016.51
7.4.290.0030.00316.52
7.4.280.0000.00716.52
7.4.270.0030.00316.57
7.4.260.0000.00716.43
7.4.250.0000.00816.49
7.4.240.0030.00416.48
7.4.230.0030.00316.36
7.4.220.0150.00316.55
7.4.210.0000.01416.55
7.4.200.0020.00516.43
7.4.160.0100.01016.60
7.4.150.0070.01017.40
7.4.140.0160.00617.86
7.4.130.0090.01016.64
7.4.120.0140.00416.67
7.4.110.0120.00616.47
7.4.100.0090.00916.61
7.4.90.0040.01316.50
7.4.80.0050.01719.39
7.4.70.0030.01416.51
7.4.60.0200.00316.37
7.4.50.0070.00716.11
7.4.40.0080.01416.49
7.4.30.0070.01416.54
7.4.00.0040.01214.90
7.3.330.0030.00313.46
7.3.320.0000.00513.35
7.3.310.0030.00316.51
7.3.300.0000.00716.25
7.3.290.0080.00816.38
7.3.280.0080.00916.38
7.3.270.0090.00817.40
7.3.260.0090.01616.45
7.3.250.0110.00916.42
7.3.240.0100.00816.35
7.3.230.0100.00716.39
7.3.210.0140.00416.52
7.3.200.0060.01016.30
7.3.190.0100.01016.39
7.3.180.0100.00716.30
7.3.170.0120.00916.46
7.3.160.0110.01116.47
7.3.120.0060.01314.82
7.3.110.0110.00715.00
7.3.100.0060.00914.86
7.3.90.0000.00914.86
7.3.80.0030.01415.04
7.3.70.0080.00614.81
7.3.60.0030.01414.64
7.3.50.0100.00614.88
7.3.40.0060.00614.94
7.3.30.0040.01214.70
7.3.20.0120.00616.52
7.3.10.0070.00716.79
7.3.00.0040.00416.85
7.2.330.0060.01216.56
7.2.320.0120.01116.66
7.2.310.0030.01316.71
7.2.300.0040.01316.62
7.2.290.0080.00816.66
7.2.250.0040.00814.82
7.2.240.0070.01315.02
7.2.230.0110.00415.11
7.2.220.0030.00914.62
7.2.210.0070.00714.98
7.2.200.0090.00615.13
7.2.190.0100.00615.04
7.2.180.0000.01214.91
7.2.170.0040.01114.75
7.2.60.0070.00616.87
7.2.00.0040.01119.52
7.1.330.0160.00015.86
7.1.320.0060.00315.92
7.1.310.0030.01015.75
7.1.300.0070.01015.89
7.1.290.0120.00015.89
7.1.280.0130.00315.68
7.1.270.0030.01215.86
7.1.260.0040.00815.80
7.1.200.0090.00315.70
7.1.100.0070.00717.70
7.1.70.0000.00717.31
7.1.60.0030.00919.50
7.1.50.0070.00716.93
7.1.00.0070.08722.41
7.0.200.0000.00816.88
7.0.100.0300.04720.00
7.0.90.0270.07019.97
7.0.80.0300.07019.97
7.0.70.0270.08020.02
7.0.60.0270.08019.84
7.0.50.0030.08320.35
7.0.40.0070.06320.16
7.0.30.0100.08320.04
7.0.20.0000.05019.96
7.0.10.0100.07720.07
7.0.00.0170.07020.02
5.6.280.0070.05020.90
5.6.250.0030.03720.58
5.6.240.0030.04020.71
5.6.230.0030.04320.59
5.6.220.0070.05320.74
5.6.210.0130.04020.61
5.6.200.0070.06721.04
5.6.190.0100.06721.02
5.6.180.0200.06321.02
5.6.170.0070.07021.03
5.6.160.0100.08021.14
5.6.150.0000.04321.04
5.6.140.0130.05721.11
5.6.130.0130.07321.11
5.6.120.0100.09720.96
5.6.110.0000.04321.07
5.6.100.0200.03720.95
5.6.90.0030.09021.07
5.6.80.0170.06320.45
5.6.70.0170.06720.38
5.6.60.0070.06020.54
5.6.50.0100.05020.32
5.6.40.0130.08020.44
5.6.30.0100.07320.32
5.6.20.0070.06320.53
5.6.10.0100.06320.47
5.6.00.0070.07320.30
5.5.380.0000.06020.57
5.5.370.0100.08320.52
5.5.360.0070.08320.35
5.5.350.0070.08320.46
5.5.340.0130.05320.93
5.5.330.0070.04720.82
5.5.320.0100.07720.84
5.5.310.0070.05320.86
5.5.300.0030.06320.77
5.5.290.0170.02720.91
5.5.280.0130.07320.92
5.5.270.0070.08320.64
5.5.260.0030.08320.92
5.5.250.0100.06020.58
5.5.240.0130.04720.29
5.5.230.0070.04320.24
5.5.220.0130.07020.15
5.5.210.0030.08720.31
5.5.200.0000.08320.20
5.5.190.0170.05020.14
5.5.180.0170.04320.29
5.5.160.0130.04320.13
5.5.150.0030.08020.21
5.5.140.0070.07720.21
5.5.130.0100.05720.15
5.5.120.0070.04720.27
5.5.110.0070.06320.18
5.5.100.0100.07320.12
5.5.90.0030.05020.08
5.5.80.0030.06020.10
5.5.70.0100.07319.94
5.5.60.0070.07720.06
5.5.50.0070.05020.06
5.5.40.0070.06320.14
5.5.30.0030.08020.05
5.5.20.0130.06320.03
5.5.10.0070.07320.05
5.5.00.0070.04719.96

preferences:
47.83 ms | 400 KiB | 5 Q