3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FactorialNum{ protected $_n; public function __construct($n){ $this->_n = $n; } public function result(){ $fatorial = 1; for($i=1; $i<$this->_n;$i++){ $factorial*=$i; } return $factoial; } } $newObj = new FactorialNum(5); $newObj->result();

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.0110.00618.86
8.3.30.0140.00019.09
8.3.20.0070.00020.23
8.3.10.0050.00323.65
8.3.00.0060.00319.68
8.2.170.0130.00622.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0080.00824.66
8.2.130.0080.00826.16
8.2.120.0050.00321.04
8.2.110.0060.00320.25
8.2.100.0080.00418.03
8.2.90.0050.00319.05
8.2.80.0000.00817.97
8.2.70.0090.00017.50
8.2.60.0050.00317.80
8.2.50.0080.00018.07
8.2.40.0040.00418.16
8.2.30.0040.00418.12
8.2.20.0000.00717.62
8.2.10.0000.00718.00
8.2.00.0000.00817.74
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0080.00423.84
8.1.230.0120.00022.06
8.1.220.0080.00417.74
8.1.210.0050.00318.77
8.1.200.0000.00917.23
8.1.190.0080.00017.22
8.1.180.0000.00818.10
8.1.170.0040.00418.66
8.1.160.0040.00421.86
8.1.150.0040.00418.63
8.1.140.0050.00217.40
8.1.130.0070.00017.88
8.1.120.0000.00817.37
8.1.110.0070.00017.41
8.1.100.0040.00417.31
8.1.90.0030.00317.41
8.1.80.0040.00417.44
8.1.70.0000.00717.37
8.1.60.0080.00017.62
8.1.50.0000.00817.53
8.1.40.0030.00617.55
8.1.30.0030.00617.67
8.1.20.0040.00417.55
8.1.10.0000.00817.41
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0000.00818.30
8.0.270.0040.00417.26
8.0.260.0000.00617.25
8.0.250.0040.00416.93
8.0.240.0040.00416.96
8.0.230.0030.00416.96
8.0.220.0060.00016.80
8.0.210.0000.00816.90
8.0.200.0060.00016.88
8.0.190.0040.00416.93
8.0.180.0000.00716.80
8.0.170.0000.00716.83
8.0.160.0080.00016.93
8.0.150.0070.00016.86
8.0.140.0060.00316.78
8.0.130.0030.00313.21
8.0.120.0050.00316.85
8.0.110.0000.00716.90
8.0.100.0000.00717.00
8.0.90.0040.00416.93
8.0.80.0100.00516.86
8.0.70.0040.00416.90
8.0.60.0070.00016.88
8.0.50.0000.00816.77
8.0.30.0150.00817.06
8.0.20.0150.00617.40
8.0.10.0040.00417.05
8.0.00.0140.00816.60
7.4.330.0050.00015.01
7.4.320.0030.00316.45
7.4.300.0000.00716.58
7.4.290.0080.00016.46
7.4.280.0000.00716.50
7.4.270.0070.00016.57
7.4.260.0030.00616.39
7.4.250.0040.00416.43
7.4.240.0040.00316.53
7.4.230.0070.00016.26
7.4.220.0130.01316.41
7.4.210.0070.00716.43
7.4.200.0030.00316.42
7.4.160.0080.00816.32
7.4.150.0040.01317.40
7.4.140.0100.00917.86
7.4.130.0100.00816.32
7.4.120.0060.01116.62
7.4.110.0000.01716.41
7.4.100.0130.01016.45
7.4.90.0100.00716.75
7.4.80.0030.01619.39
7.4.70.0120.00616.50
7.4.60.0150.00616.31
7.4.50.0050.00316.32
7.4.40.0080.01016.54
7.4.30.0090.00616.36
7.4.10.0060.01215.14
7.4.00.0110.00614.94
7.3.330.0060.00013.41
7.3.320.0040.00413.45
7.3.310.0000.00716.46
7.3.300.0040.00416.45
7.3.290.0110.00316.40
7.3.280.0090.01016.42
7.3.270.0160.00317.40
7.3.260.0150.00416.45
7.3.250.0110.01016.63
7.3.240.0000.01816.34
7.3.230.0100.00716.64
7.3.210.0110.00516.51
7.3.200.0090.01319.39
7.3.190.0120.00616.46
7.3.180.0060.01216.50
7.3.170.0090.00616.48
7.3.160.0060.01516.33
7.3.130.0030.01015.13
7.3.120.0070.00914.69
7.3.110.0120.00615.12
7.3.100.0070.00714.98
7.3.90.0070.00714.93
7.3.80.0080.00414.72
7.3.70.0090.00014.78
7.3.60.0140.00014.93
7.3.50.0060.00614.87
7.3.40.0030.01014.79
7.3.30.0000.01414.77
7.3.20.0000.01416.76
7.3.10.0130.00316.42
7.3.00.0040.00416.46
7.2.330.0080.00916.46
7.2.320.0160.00716.36
7.2.310.0130.00316.47
7.2.300.0110.00716.74
7.2.290.0060.00916.50
7.2.260.0100.00715.00
7.2.250.0070.01115.17
7.2.240.0040.01115.08
7.2.230.0110.00415.16
7.2.220.0070.01114.90
7.2.210.0030.01115.02
7.2.200.0070.01015.13
7.2.190.0120.00615.11
7.2.180.0100.00314.74
7.2.170.0090.00314.96
7.2.160.0070.01015.18
7.2.150.0030.01016.99
7.2.140.0070.00716.75
7.2.130.0060.00617.00
7.2.120.0080.00616.89
7.2.110.0100.00317.13
7.2.100.0040.00416.88
7.2.90.0030.00716.99
7.2.80.0040.01116.97
7.2.70.0070.00717.05
7.2.60.0090.00516.90
7.2.50.0090.00616.69
7.2.40.0060.00316.95
7.2.30.0030.01216.63
7.2.20.0070.00716.94
7.2.10.0000.01416.93
7.2.00.0090.00718.04
7.1.330.0040.00815.70
7.1.320.0000.01015.80
7.1.310.0060.00615.91
7.1.300.0000.01115.51
7.1.290.0030.01015.65
7.1.280.0070.00315.57
7.1.270.0140.00015.72
7.1.260.0000.00815.56
7.1.250.0030.00715.73
7.1.240.0110.00315.38
7.1.230.0000.01215.86
7.1.220.0070.00715.50
7.1.210.0100.00315.60
7.1.200.0070.00515.63
7.1.190.0000.01115.86
7.1.180.0030.01015.52
7.1.170.0060.01015.52
7.1.160.0030.00615.41
7.1.150.0140.00015.42
7.1.140.0070.00715.83
7.1.130.0070.00715.72
7.1.120.0040.00415.41
7.1.110.0040.00415.63
7.1.100.0050.00516.78
7.1.90.0000.01015.67
7.1.80.0030.01015.74
7.1.70.0060.00616.43
7.1.60.0070.01117.67
7.1.50.0050.01416.33
7.1.40.0040.00715.76
7.1.30.0000.00915.75
7.1.20.0040.00715.76
7.1.10.0100.00315.57
7.1.00.0030.04418.92
7.0.330.0100.00315.41
7.0.320.0060.00615.27
7.0.310.0060.00315.11
7.0.300.0070.00715.09
7.0.290.0060.00615.32
7.0.280.0000.01015.37
7.0.270.0060.00315.48
7.0.260.0030.01015.19
7.0.250.0030.01115.47
7.0.240.0030.01015.43
7.0.230.0040.00415.47
7.0.220.0070.00315.52
7.0.210.0070.00315.38
7.0.200.0060.00516.08
7.0.190.0030.00915.24
7.0.180.0040.00415.50
7.0.170.0100.00315.36
7.0.160.0070.01015.48
7.0.150.0070.00715.30
7.0.140.0050.03518.76
7.0.130.0060.00615.45
7.0.120.0100.00315.39
7.0.110.0070.00715.45
7.0.100.0030.01015.48
7.0.90.0030.00615.48
7.0.80.0080.00315.46
7.0.70.0000.01015.27
7.0.60.0000.04917.64
7.0.50.0030.05016.67
7.0.40.0050.04916.83
7.0.30.0200.04516.84
7.0.20.0180.04016.88
7.0.10.0270.03316.80
7.0.00.0010.02616.70
5.6.400.0070.00314.66
5.6.390.0100.00014.36
5.6.380.0050.00514.39
5.6.370.0030.00914.49
5.6.360.0110.00314.16
5.6.350.0060.00614.10
5.6.340.0080.00614.56
5.6.330.0110.00314.42
5.6.320.0040.00414.25
5.6.310.0030.01014.67
5.6.300.0090.00614.27
5.6.290.0070.00714.36
5.6.280.0040.04317.51
5.6.270.0040.00814.44
5.6.260.0100.00614.55
5.6.250.0080.00314.66
5.6.240.0080.00614.43
5.6.230.0030.00914.30
5.6.220.0030.00614.41
5.6.210.0080.04317.56
5.6.200.0030.02816.37
5.6.190.0030.04817.56
5.6.180.1830.02717.47
5.6.170.0100.02817.54
5.6.160.0010.02617.38
5.6.150.0100.03716.45
5.6.140.0100.04016.28
5.6.130.0130.02116.36
5.6.120.0080.04217.87
5.6.110.0080.03017.90
5.6.100.0070.04517.80
5.6.90.0050.03717.62
5.6.80.0050.02217.39
5.6.70.0200.03917.35
5.6.60.0040.01114.38
5.6.50.0060.00614.49
5.6.40.0030.00914.36
5.6.30.0000.01414.41
5.6.20.0040.01114.38
5.6.10.0040.00814.35
5.6.00.0030.00914.23
5.5.380.0030.00914.43
5.5.370.0100.00614.59
5.5.360.0060.00314.57
5.5.350.0180.03617.42
5.5.340.0100.03816.12
5.5.330.0070.03017.34
5.5.320.0130.02217.32
5.5.310.0200.03517.42
5.5.300.0030.04816.18
5.5.290.0080.03016.22
5.5.280.0050.04517.60
5.5.270.0050.03417.63
5.5.260.0090.04617.56
5.5.250.0090.03817.32
5.5.240.0020.04417.21
5.5.230.0040.00814.08
5.5.220.0040.00714.07
5.5.210.0060.00614.41
5.5.200.0070.00314.45
5.5.190.0060.00314.39
5.5.180.0000.01114.25
5.5.170.0000.01314.49
5.5.160.0090.00314.32
5.5.150.0030.01014.39
5.5.140.0060.00614.10
5.5.130.0070.00414.25
5.5.120.0030.01014.25
5.5.110.0060.00314.41
5.5.100.0080.00314.05
5.5.90.0060.00614.23
5.5.80.0070.00714.21
5.5.70.0090.00314.43
5.5.60.0030.00914.43
5.5.50.0130.00314.38
5.5.40.0120.00013.93
5.5.30.0050.00514.08
5.5.20.0000.01014.44
5.5.10.0140.00314.59
5.5.00.0060.00614.41
5.4.450.0240.02027.47
5.4.440.0430.03415.33
5.4.430.0430.03315.26
5.4.420.0370.00315.36
5.4.410.0080.03115.13
5.4.400.0130.03214.86
5.4.390.0200.03314.98
5.4.380.0170.02814.92
5.4.370.0030.02615.05
5.4.360.0010.02414.89
5.4.350.0050.02111.47
5.4.340.0050.01911.47
5.4.330.0030.00710.91
5.4.320.0040.02911.71
5.4.310.0040.02811.80
5.4.300.0050.02111.82
5.4.290.0020.02511.78
5.4.280.0050.02011.77
5.4.270.0060.02411.66
5.4.260.0040.02311.85
5.4.250.0040.02211.66
5.4.240.0040.02711.66
5.4.230.0080.02111.73
5.4.220.0040.02011.74
5.4.210.0050.02111.65
5.4.200.0070.02411.84
5.4.190.0060.01911.65
5.4.180.0070.01911.72
5.4.170.0070.02211.66
5.4.160.0070.02011.75
5.4.150.0040.02111.75
5.4.140.0040.02211.69
5.4.130.0030.02511.62
5.4.120.0070.01911.53
5.4.110.0040.02311.46
5.4.100.0050.02611.52
5.4.90.0050.02011.58
5.4.80.0070.02211.65
5.4.70.0020.02211.51
5.4.60.0040.02411.46
5.4.50.0100.01811.60
5.4.40.0070.02211.46
5.4.30.0100.01611.61
5.4.20.0060.02011.58
5.4.10.0050.02011.56
5.4.00.0070.01611.29
5.3.290.0080.02511.86
5.3.280.0020.02611.81
5.3.270.0070.02211.82
5.3.260.0040.02511.82
5.3.250.0040.02611.81
5.3.240.0080.02311.82
5.3.230.0080.02411.81
5.3.220.0060.02311.80
5.3.210.0080.02411.80
5.3.200.0070.02511.80
5.3.190.0060.02311.79
5.3.180.0050.01911.79
5.3.170.0070.02111.79
5.3.160.0040.02311.79
5.3.150.0030.02411.79
5.3.140.0070.02011.79
5.3.130.0040.02711.79
5.3.120.0070.02211.79
5.3.110.0050.02311.79
5.3.100.0070.02111.52
5.3.90.0050.02311.51
5.3.80.0050.02411.50
5.3.70.0080.02411.50
5.3.60.0070.01811.49
5.3.50.0020.02211.47
5.3.40.0030.02111.47
5.3.30.0040.02211.45
5.3.20.0060.02011.34
5.3.10.0050.02211.32
5.3.00.0060.02011.31
5.2.170.0050.0309.23
5.2.160.0050.0329.22
5.2.150.0060.0339.23
5.2.140.0030.0359.22
5.2.130.0050.0309.18
5.2.120.0030.0309.18
5.2.110.0050.0289.20
5.2.100.0040.0299.18
5.2.90.0060.0289.18
5.2.80.0060.0299.18
5.2.70.0070.0359.18
5.2.60.0050.0309.13
5.2.50.0040.0349.09
5.2.40.0080.0339.07
5.2.30.0110.0289.05
5.2.20.0030.0339.04
5.2.10.0060.0308.95
5.2.00.0060.0288.81
5.1.60.0060.0238.09
5.1.50.0060.0238.08
5.1.40.0030.0258.07
5.1.30.0040.0268.42
5.1.20.0030.0338.44
5.1.10.0050.0258.16
5.1.00.0050.0258.16
5.0.50.0040.0206.64
5.0.40.0050.0196.50
5.0.30.0060.0296.32
5.0.20.0030.0216.29
5.0.10.0080.0166.26
5.0.00.0040.0306.25
4.4.90.0070.0114.78
4.4.80.0020.0164.75
4.4.70.0010.0174.75
4.4.60.0030.0164.76
4.4.50.0050.0144.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0010.0174.84
4.4.10.0050.0184.85
4.4.00.0030.0244.76
4.3.110.0030.0224.67
4.3.100.0030.0154.67
4.3.90.0020.0154.64
4.3.80.0060.0214.58
4.3.70.0040.0134.63
4.3.60.0040.0134.63
4.3.50.0040.0144.63
4.3.40.0010.0264.54
4.3.30.0020.0163.30
4.3.20.0020.0163.28
4.3.10.0030.0153.23
4.3.00.0030.02043.80

preferences:
67.2 ms | 400 KiB | 5 Q