3v4l.org

run code in 300+ PHP versions simultaneously
<?php function perfect($n) { if ($n < 1) { echo "Number has to be Positive."; return false; } for($i = 1; $i <= $n; $i++) { if ($n % $i == 0) { $factors[] = $i; } } return ($n == array_sum($factors) / 2) ? true : false; } perfect(42); ?>

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.0140.00718.73
8.3.30.0040.01219.19
8.3.20.0080.00019.95
8.3.10.0060.00322.07
8.3.00.0000.00722.54
8.2.170.0110.00422.96
8.2.160.0100.00720.80
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0020.00526.16
8.2.120.0040.00419.43
8.2.110.0030.00720.15
8.2.100.0080.00417.84
8.2.90.0050.00319.34
8.2.80.0000.00817.97
8.2.70.0000.00917.63
8.2.60.0000.00817.91
8.2.50.0000.00818.07
8.2.40.0060.00318.22
8.2.30.0050.00318.08
8.2.20.0020.00517.77
8.2.10.0030.00617.66
8.2.00.0050.00517.74
8.1.270.0000.00821.87
8.1.260.0080.00026.35
8.1.250.0000.00928.09
8.1.240.0030.00620.93
8.1.230.0030.00717.44
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0000.00817.23
8.1.190.0040.00417.40
8.1.180.0040.00418.10
8.1.170.0090.00018.69
8.1.160.0080.00022.07
8.1.150.0000.00818.58
8.1.140.0020.00517.50
8.1.130.0000.00717.84
8.1.120.0050.00217.36
8.1.110.0040.00417.46
8.1.100.0030.00517.45
8.1.90.0040.00417.38
8.1.80.0000.00717.36
8.1.70.0000.00717.45
8.1.60.0030.00617.59
8.1.50.0000.00717.57
8.1.40.0040.00417.51
8.1.30.0040.00417.53
8.1.20.0030.00517.70
8.1.10.0040.00417.51
8.1.00.0050.00317.32
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0080.00017.18
8.0.260.0060.00316.87
8.0.250.0040.00416.98
8.0.240.0040.00416.95
8.0.230.0040.00417.01
8.0.220.0000.00716.88
8.0.210.0000.00716.82
8.0.200.0000.00716.93
8.0.190.0040.00416.93
8.0.180.0040.00416.92
8.0.170.0040.00416.93
8.0.160.0000.00816.76
8.0.150.0030.00316.84
8.0.140.0080.00016.78
8.0.130.0000.00613.32
8.0.120.0040.00416.93
8.0.110.0000.00716.85
8.0.100.0040.00416.67
8.0.90.0050.00216.88
8.0.80.0120.00916.87
8.0.70.0030.00516.76
8.0.60.0000.00716.72
8.0.50.0000.00716.91
8.0.30.0090.00917.13
8.0.20.0160.00717.43
8.0.10.0030.00516.91
8.0.00.0140.00316.90
7.4.330.0030.00315.16
7.4.320.0030.00316.59
7.4.300.0030.00316.36
7.4.290.0030.00316.59
7.4.280.0030.00316.60
7.4.270.0030.00316.50
7.4.260.0060.00316.64
7.4.250.0000.00816.57
7.4.240.0070.00016.55
7.4.230.0000.00716.60
7.4.220.0110.00916.67
7.4.210.0090.00816.56
7.4.200.0080.00016.37
7.4.190.0030.00516.65
7.4.160.0160.00016.45
7.4.150.0140.00617.40
7.4.140.0050.01217.86
7.4.130.0120.00616.50
7.4.120.0090.00916.65
7.4.110.0130.00316.64
7.4.100.0110.00616.51
7.4.90.0030.01516.44
7.4.80.0190.00019.39
7.4.70.0090.00616.52
7.4.60.0060.00916.48
7.4.50.0000.00916.57
7.4.40.0070.01022.77
7.4.30.0120.00416.47
7.4.00.0080.01014.92
7.3.330.0020.00213.16
7.3.320.0030.00313.22
7.3.310.0040.00416.40
7.3.300.0060.00016.18
7.3.290.0140.00416.30
7.3.280.0060.00916.26
7.3.270.0170.00317.40
7.3.260.0160.00316.38
7.3.250.0100.01016.45
7.3.240.0110.00616.40
7.3.230.0100.00716.39
7.3.210.0100.00716.32
7.3.200.0160.00619.39
7.3.190.0130.01016.49
7.3.180.0040.01216.37
7.3.170.0150.00016.58
7.3.160.0090.00616.40
7.3.120.0100.00515.03
7.3.110.0030.01414.33
7.3.100.0030.01015.02
7.3.90.0030.01014.55
7.3.80.0040.00714.98
7.3.70.0060.00314.84
7.3.60.0000.01514.70
7.3.50.0060.00314.77
7.3.40.0140.00014.62
7.3.30.0030.00914.83
7.3.20.0040.01116.59
7.3.10.0070.00716.64
7.3.00.0150.00016.62
7.2.330.0100.00716.61
7.2.320.0120.01216.73
7.2.310.0130.00716.73
7.2.300.0060.01316.66
7.2.290.0100.00716.68
7.2.250.0070.01015.00
7.2.240.0030.01714.79
7.2.230.0070.01015.02
7.2.220.0120.00315.30
7.2.210.0090.00314.75
7.2.200.0000.01415.20
7.2.190.0040.00415.09
7.2.180.0030.00614.97
7.2.170.0030.01014.95
7.2.60.0070.00716.94
7.1.330.0040.01115.73
7.1.320.0060.01215.57
7.1.310.0040.01115.70
7.1.300.0030.00615.83
7.1.290.0080.00415.63
7.1.280.0140.00015.98
7.1.270.0050.00515.84
7.1.260.0080.00415.90
7.1.200.0030.00915.80
7.1.70.0030.01017.07
7.1.60.0070.01719.82
7.1.50.0110.01117.05
7.1.00.0100.06722.51
7.0.200.0000.00816.53
7.0.140.0030.07022.09
7.0.70.3500.04019.86
7.0.60.3570.03719.98
7.0.50.3570.03320.25
7.0.40.3230.03720.04
7.0.30.3700.04020.13
7.0.20.3600.04020.17
7.0.10.3800.04020.09
7.0.00.4130.05020.13
5.6.280.0100.06021.11
5.6.210.3270.03020.41
5.6.200.3330.03321.04
5.6.190.3530.03021.02
5.6.180.3330.04321.14
5.6.170.3630.04021.11
5.6.160.4330.04021.07
5.6.150.4370.03721.02
5.6.140.3870.04321.05
5.6.130.4400.04320.99
5.6.120.3670.03321.00
5.6.110.4300.04320.93
5.6.100.3700.03721.16
5.6.90.3700.05021.09
5.6.80.4030.04020.52
5.6.70.3970.04020.46
5.6.60.4330.04020.38
5.6.50.4170.04020.50
5.6.40.4430.05320.49
5.6.30.3470.04320.38
5.6.20.3000.03020.38
5.6.10.3800.04320.49
5.6.00.3830.04020.51
5.5.350.3200.03320.32
5.5.340.3470.03720.89
5.5.330.3270.03020.63
5.5.320.3070.03720.86
5.5.310.3070.03720.86
5.5.300.3800.04320.91
5.5.290.3870.04020.84
5.5.280.4100.04320.89
5.5.270.4200.03320.75
5.5.260.4270.04320.79
5.5.250.4130.03720.66
5.5.240.4400.03320.30
5.5.230.3970.04320.30
5.5.220.4100.03720.15
5.5.210.4300.03720.29
5.5.200.3830.03720.15
5.5.190.3600.04020.22
5.5.180.3500.04319.99
5.5.160.4170.04320.16
5.5.150.3700.03320.14
5.5.140.4530.02720.27
5.5.130.3070.03020.17
5.5.120.3530.03720.23
5.5.110.3400.04020.26
5.5.100.3870.04720.08
5.5.90.4370.04020.06
5.5.80.3700.04020.07
5.5.70.4330.04020.15
5.5.60.4170.03720.05
5.5.50.4070.03320.10
5.5.40.3530.03320.03
5.5.30.3400.04320.08
5.5.20.4070.03020.00
5.5.10.3970.03320.03
5.5.00.4100.03720.01
5.4.450.4430.03319.48
5.4.440.3900.04019.36
5.4.430.3900.04319.35
5.4.420.4200.03719.35
5.4.410.3900.03719.33
5.4.400.4500.03319.09
5.4.390.4370.03718.88
5.4.380.3700.04719.18
5.4.370.4370.03719.23
5.4.360.4270.04019.05
5.4.350.3930.03719.03
5.4.340.3500.04018.95
5.4.320.4070.03719.16
5.4.310.3170.02719.14
5.4.300.4400.04019.11
5.4.290.3870.04018.90
5.4.280.3570.04019.14
5.4.270.3400.03318.85
5.4.260.3570.04019.09
5.4.250.4300.03719.17
5.4.240.4270.03719.09
5.4.230.4500.04019.02
5.4.220.3370.04319.11
5.4.210.4630.03319.11
5.4.200.3570.04019.17
5.4.190.3470.03019.20
5.4.180.3770.03719.17
5.4.170.4200.04318.86
5.4.160.3300.04019.12
5.4.150.1300.05018.83
5.4.140.0100.07016.37
5.4.130.1170.05016.35
5.4.120.4230.04016.38
5.4.110.3300.03016.50
5.4.100.2930.02716.47
5.4.90.3170.02716.47
5.4.80.2770.03716.46
5.4.70.3270.03716.45
5.4.60.3630.03716.43
5.4.50.2900.03316.34
5.4.40.3070.04016.37
5.4.30.3230.03016.31
5.4.20.0030.02716.44
5.4.10.3370.03016.36
5.4.00.3170.02315.73
5.3.290.3330.03314.65
5.3.280.4230.04014.52
5.3.270.3970.04014.54
5.3.260.4030.03714.55
5.3.250.4300.03714.67
5.3.240.0130.07014.71
5.3.230.4430.03714.69
5.3.220.3500.03714.57
5.3.210.3270.03014.68
5.3.200.3270.02314.62
5.3.190.3530.03714.53
5.3.180.3270.03714.58
5.3.170.3570.04314.50
5.3.160.3330.03714.70
5.3.150.2600.03314.48
5.3.140.2930.03014.53
5.3.130.1400.02714.65
5.3.120.0100.05714.63
5.3.110.0030.03714.64
5.3.100.3970.04014.07
5.3.90.3700.03714.07
5.3.80.4370.03714.00
5.3.70.4070.03014.16
5.3.60.4170.03714.01
5.3.50.4070.03713.98
5.3.40.4230.04313.92
5.3.30.4300.03713.96
5.3.20.4030.03313.75
5.3.10.4300.03313.70
5.3.00.4230.03013.62
5.2.170.3330.02711.19
5.2.160.3670.03011.04
5.2.150.3330.02311.15
5.2.140.3630.02311.25
5.2.130.3630.02710.98
5.2.120.3530.03011.15
5.2.110.3700.02310.95
5.2.100.3170.02711.20
5.2.90.3230.02011.04
5.2.80.2730.03311.14
5.2.70.1970.02711.16
5.2.60.1730.03011.18
5.2.50.2070.02310.93
5.2.40.1670.02311.05
5.2.30.1900.01710.88
5.2.20.1730.02710.98
5.2.10.2500.02710.91
5.2.00.2770.02310.57
5.1.60.2700.02010.04
5.1.50.2830.02310.08
5.1.40.3030.0239.81
5.1.30.2930.02310.29
5.1.20.2530.02310.40
5.1.10.2300.02710.09
5.1.00.2070.02710.05
5.0.50.1670.0238.38
5.0.40.1230.0238.27
5.0.30.1600.0338.29
5.0.20.1100.0178.25
5.0.10.1630.0238.20
5.0.00.1400.0308.00
4.4.90.0600.0175.86
4.4.80.1230.0135.90
4.4.70.1170.0205.92
4.4.60.0670.0075.89
4.4.50.0930.0135.90
4.4.40.1630.0275.84
4.4.30.1670.0175.80
4.4.20.1200.0135.93
4.4.10.1100.0105.96
4.4.00.1670.0275.85
4.3.110.1770.0135.72
4.3.100.1670.0135.82
4.3.90.1600.0175.72
4.3.80.1700.0235.77
4.3.70.1630.0175.79
4.3.60.1330.0135.78
4.3.50.1500.0175.73
4.3.40.1400.0235.72
4.3.30.0300.0275.72
4.3.20.0630.0175.72
4.3.10.0730.0205.72
4.3.00.0800.0235.72

preferences:
54.83 ms | 400 KiB | 5 Q