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(500);?>

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.40.0100.00718.71
8.3.30.0110.00619.17
8.3.20.0050.00520.21
8.3.10.0070.00321.88
8.3.00.0060.00317.89
8.2.170.0170.00722.96
8.2.160.0070.01019.24
8.2.150.0030.00624.18
8.2.140.0070.00324.66
8.2.130.0060.00326.16
8.2.120.0060.00326.16
8.2.110.0050.00522.13
8.2.100.0070.00719.64
8.2.90.0030.00619.23
8.2.80.0060.00317.97
8.2.70.0030.01017.38
8.2.60.0040.00817.93
8.2.50.0000.01018.07
8.2.40.0040.00718.16
8.2.30.0090.00018.08
8.2.20.0030.00617.88
8.2.10.0000.00918.24
8.2.00.0090.00017.86
8.1.270.0030.00624.66
8.1.260.0000.00926.35
8.1.250.0160.00628.09
8.1.240.0070.00323.84
8.1.230.0090.00319.12
8.1.220.0070.00317.91
8.1.210.0060.00318.77
8.1.200.0000.01217.25
8.1.190.0060.00317.35
8.1.180.0000.01018.10
8.1.170.0030.00618.78
8.1.160.0090.00022.08
8.1.150.0030.00618.94
8.1.140.0070.00317.51
8.1.130.0030.00618.00
8.1.120.0030.00617.59
8.1.110.0030.00717.52
8.1.100.0000.00917.48
8.1.90.0060.00317.47
8.1.80.0030.00617.42
8.1.70.0000.00917.48
8.1.60.0030.00717.72
8.1.50.0000.01017.65
8.1.40.0030.00617.55
8.1.30.0030.00617.70
8.1.20.0000.00917.66
8.1.10.0000.00917.59
8.1.00.0060.00317.47
8.0.300.0060.00318.77
8.0.290.0000.01016.63
8.0.280.0060.00318.46
8.0.270.0030.00716.92
8.0.260.0060.00317.36
8.0.250.0090.00017.03
8.0.240.0000.01017.02
8.0.230.0000.01116.93
8.0.220.0040.00416.89
8.0.210.0090.00316.88
8.0.200.0000.01017.00
8.0.190.0050.00517.09
8.0.180.0040.00416.96
8.0.170.0070.00317.05
8.0.160.0030.00716.78
8.0.150.0030.00616.89
8.0.140.0030.00716.91
8.0.130.0040.00413.40
8.0.120.0000.00916.98
8.0.110.0000.00916.90
8.0.100.0030.00616.99
8.0.90.0000.00917.00
8.0.80.0130.00716.93
8.0.70.0000.01017.00
8.0.60.0000.01016.78
8.0.50.0050.00516.74
8.0.30.0060.01717.26
8.0.20.0080.01717.40
8.0.10.0090.01217.11
8.0.00.0080.01316.84
7.4.330.0050.00015.02
7.4.320.0000.00816.71
7.4.300.0030.00616.58
7.4.290.0060.00316.64
7.4.280.0030.00916.58
7.4.270.0050.00516.71
7.4.260.0030.00616.45
7.4.250.0040.00416.52
7.4.240.0070.00216.62
7.4.230.0050.00516.78
7.4.220.0070.01416.62
7.4.210.0100.00916.68
7.4.200.0030.00616.67
7.4.160.0060.01316.54
7.4.150.0090.01217.40
7.4.140.0070.01417.39
7.4.130.0120.01016.51
7.4.120.0080.01316.57
7.4.110.0130.00816.63
7.4.100.0100.01116.64
7.4.90.0050.01616.57
7.4.80.0130.01117.42
7.4.70.0080.01216.66
7.4.60.0080.01516.41
7.4.50.0100.00716.59
7.4.40.0120.01216.60
7.4.30.0090.01616.48
7.4.20.0090.01316.56
7.4.10.0130.01116.61
7.4.00.0160.01416.04
7.3.330.0030.00413.26
7.3.320.0000.00613.15
7.3.310.0000.00916.27
7.3.300.0000.00916.37
7.3.290.0030.01316.28
7.3.280.0050.01716.39
7.3.260.0090.01116.48
7.3.250.0070.01316.46
7.3.240.0150.01016.41
7.3.230.0110.01016.51
7.3.220.0050.01516.36
7.3.210.0090.01216.57
7.3.200.0090.01216.43
7.3.190.0130.01116.25
7.3.180.0080.01716.26
7.3.170.0120.00916.41
7.3.160.0130.00816.42
7.3.150.0090.01616.34
7.3.140.0120.00916.43
7.3.130.0090.01216.44
7.3.120.0130.01316.07
7.3.110.0120.01815.96
7.3.100.0160.01415.81
7.3.90.0090.01516.05
7.3.80.0090.01515.94
7.3.70.0130.01015.91
7.3.60.0130.00815.78
7.3.50.0110.01015.89
7.3.40.0120.01015.91
7.3.30.0120.00915.81
7.3.20.0100.01216.31
7.3.10.0130.00916.30
7.3.00.0090.01116.45
7.2.340.0070.01816.73
7.2.330.0170.01116.69
7.2.320.0140.01216.60
7.2.310.0140.01216.56
7.2.300.0140.01116.74
7.2.290.0090.01416.73
7.2.280.0130.01016.79
7.2.270.0130.01216.55
7.2.260.0120.01816.67
7.2.250.0130.02116.61
7.2.240.0150.01416.36
7.2.230.0130.01416.30
7.2.220.0060.01316.43
7.2.210.0120.01116.14
7.2.200.0090.01216.33
7.2.190.0090.01016.20
7.2.180.0100.01016.21
7.2.170.0050.01516.27
7.2.160.0070.01416.19
7.2.150.0090.01316.80
7.2.140.0090.01316.75
7.2.130.0090.01216.71
7.2.120.0060.01416.78
7.2.110.0100.01116.76
7.2.100.0200.00816.65
7.2.90.0180.01116.71
7.2.80.0140.00716.77
7.2.70.0100.01416.78
7.2.60.0070.01316.79
7.2.50.0110.01316.77
7.2.40.0090.01316.80
7.2.30.0100.01116.71
7.2.20.0170.01416.78
7.2.10.0100.01316.58
7.2.00.0100.01216.59
7.1.330.0140.01415.56
7.1.320.0170.00915.68
7.1.310.0170.01415.57
7.1.300.0140.01115.48
7.1.290.0150.01315.49
7.1.280.0090.01315.39
7.1.270.0140.01115.47
7.1.260.0140.00915.35
7.1.250.0130.01315.55
7.1.240.0110.01715.25
7.1.230.0250.01115.35
7.1.220.0170.01115.39
7.1.210.0140.01215.24
7.1.200.0120.01215.59
7.1.190.0200.01115.30
7.1.180.0190.01315.33
7.1.170.0210.01015.50
7.1.160.0140.01515.33
7.1.150.0310.00815.42
7.1.140.0180.01115.32
7.1.130.0120.01615.34
7.1.120.0190.01015.42
7.1.110.0180.01015.50
7.1.100.0150.01215.35
7.1.90.0140.01315.42
7.1.80.0320.01315.43
7.1.70.0160.01015.74
7.1.60.0130.01516.40
7.1.50.0140.01615.78
7.1.40.0180.00915.51
7.1.30.0130.01615.46
7.1.20.0170.01115.52
7.1.10.0210.01115.39
7.1.00.0160.02517.07
7.0.330.0160.01315.19
7.0.320.0130.01315.15
7.0.310.0150.01215.13
7.0.300.0190.01115.13
7.0.290.0200.00915.08
7.0.280.0140.01615.05
7.0.270.0090.01915.03
7.0.260.0170.01215.09
7.0.250.0200.01115.15
7.0.240.0160.01115.26
7.0.230.0180.01315.08
7.0.220.0240.00715.03
7.0.210.0180.01015.07
7.0.200.0120.01115.54
7.0.190.0160.01315.11
7.0.180.0180.01015.02
7.0.170.0180.01115.01
7.0.160.0110.01715.12
7.0.150.0150.01415.24
7.0.140.0140.02616.85
7.0.130.0160.01115.18
7.0.120.0130.01415.08
7.0.110.0160.00915.12
7.0.100.0110.01315.04
7.0.90.0120.01214.98
7.0.80.0150.01014.98
7.0.70.0130.03016.75
7.0.60.0120.02916.73
7.0.50.0120.03016.76
7.0.40.0200.02916.33
7.0.30.0180.02816.27
7.0.20.0180.03016.23
7.0.10.0110.02516.39
7.0.00.0130.02116.30
5.6.400.0130.01315.84
5.6.390.0180.02115.74
5.6.380.0210.00815.85
5.6.370.0130.01615.78
5.6.360.0120.01815.83
5.6.350.0190.01015.76
5.6.340.0140.01515.95
5.6.330.0180.01215.82
5.6.320.0150.01715.97
5.6.310.0170.01415.97
5.6.300.0130.02115.68
5.6.290.0170.01315.74
5.6.280.0150.01515.69
5.6.270.0140.01515.79
5.6.260.0100.02315.76
5.6.250.0150.01315.72
5.6.240.0190.00915.70
5.6.230.0140.01615.76
5.6.220.0150.03616.94
5.6.210.0120.02417.03
5.6.200.0090.03017.08
5.6.190.0090.03517.13
5.6.180.0140.03417.17
5.6.170.0090.03717.18
5.6.160.0080.03217.13
5.6.150.0130.03217.12
5.6.140.0160.02117.13
5.6.130.0120.03217.13
5.6.120.0150.03217.18
5.6.110.0170.03117.15
5.6.100.0150.03116.96
5.6.90.0130.02416.99
5.6.80.0080.02916.86
5.6.70.0160.02816.90
5.6.60.0150.03016.92
5.6.50.0170.02516.92
5.6.40.0130.02016.90
5.6.30.0110.03316.92
5.6.20.0100.02816.93
5.6.10.0100.02516.90
5.6.00.0120.02517.01
5.5.380.0160.01515.87
5.5.370.0150.01515.65
5.5.360.0130.03216.96
5.5.350.0130.02416.88
5.5.340.0110.03016.86
5.5.330.0110.02617.10
5.5.320.0110.02917.04
5.5.310.0090.03317.14
5.5.300.0120.03317.04
5.5.290.0110.03116.97
5.5.280.0130.03117.06
5.5.270.0110.03517.02
5.5.260.0130.03517.04
5.5.250.0120.02016.90
5.5.240.0150.02116.85
5.5.230.0110.02816.76
5.5.220.0120.03216.92
5.5.210.0150.02816.84
5.5.200.0090.03216.79
5.5.190.0080.03616.85
5.5.180.0120.03316.86
5.5.170.0120.02015.59
5.5.160.0140.03016.80
5.5.150.0110.02816.89
5.5.140.0130.02516.88
5.5.130.0080.03416.88
5.5.120.0110.03416.99
5.5.110.0140.02416.76
5.5.100.0130.03116.89
5.5.90.0120.03316.98
5.5.80.0120.02616.81
5.5.70.0100.02816.72
5.5.60.0130.03116.78
5.5.50.0080.03516.80
5.5.40.0120.03316.81
5.5.30.0110.03216.79
5.5.20.0160.02716.78
5.5.10.0140.03116.76
5.5.00.0150.02516.76
5.4.450.0100.02014.95
5.4.440.0140.02614.83
5.4.430.0080.02814.89
5.4.420.0130.02314.92
5.4.410.0090.02714.88
5.4.400.0090.02314.79
5.4.390.0100.01914.80
5.4.380.0100.02714.85
5.4.370.0100.02614.71
5.4.360.0080.02214.79
5.4.350.0100.02314.70
5.4.340.0120.02214.75
5.4.330.0120.00613.36
5.4.320.0080.02814.72
5.4.310.0140.02114.78
5.4.300.0090.02714.86
5.4.290.0120.02414.93
5.4.280.0110.02514.78
5.4.270.0090.02114.86
5.4.260.0090.02414.73
5.4.250.0080.02714.79
5.4.240.0070.02714.74
5.4.230.0120.01614.74
5.4.220.0070.01914.80
5.4.210.0110.02514.85
5.4.200.0090.02614.78
5.4.190.0130.02314.79
5.4.180.0090.02214.78
5.4.170.0090.02714.85
5.4.160.0090.02614.77
5.4.150.0130.02114.83
5.4.140.0130.02214.12
5.4.130.0110.02314.21
5.4.120.0080.02014.18
5.4.110.0130.02314.18
5.4.100.0160.01114.13
5.4.90.0120.02214.19
5.4.80.0090.02114.21
5.4.70.0110.02014.18
5.4.60.0080.02714.16
5.4.50.0100.02314.11
5.4.40.0080.02214.21
5.4.30.0070.02314.16
5.4.20.0060.02614.13
5.4.10.0080.02814.18
5.4.00.0070.02914.02
5.3.290.0120.03414.05
5.3.280.0080.02913.99
5.3.270.0110.02814.01
5.3.260.0090.03014.05
5.3.250.0120.02914.07
5.3.240.0120.02414.00
5.3.230.0080.03114.02
5.3.220.0140.02514.00
5.3.210.0120.02913.95
5.3.200.0100.02813.96
5.3.190.0110.02113.95
5.3.180.0110.03214.04
5.3.170.0100.03214.05
5.3.160.0100.03114.07
5.3.150.0100.03014.04
5.3.140.0130.02814.02
5.3.130.0070.03114.01
5.3.120.0100.03014.01
5.3.110.0090.03114.01
5.3.100.0110.03113.92
5.3.90.0080.03014.02
5.3.80.0080.02613.83
5.3.70.0090.02513.88
5.3.60.0100.01913.88
5.3.50.0070.03113.85
5.3.40.0080.02713.80
5.3.30.0090.02313.89
5.3.20.0080.02113.77
5.3.10.0110.02413.68
5.3.00.0070.02813.70

preferences:
40.19 ms | 400 KiB | 5 Q