3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pfactor($n){ // max_n = 2^31-1 = 2147483647 $d=42; $factors = array(); $dmax = floor(sqrt($n)); $sieve = array(); $sieve = array_fill(1, $dmax,1); do{ $r = false; while ($n%$d==0){ $factors[$d]++; $n/=$d; $r = true; } if ($r){ $dmax = floor(sqrt($n)); } if ($n>1){ for ($i=$d;$i<=$dmax;$i+=$d){ $sieve[$i]=0; } do{ $d++; }while ($sieve[$d]!=1 && $d<$dmax); if ($d>$dmax){ $factors[$n]++; } } }while($n>1 && $d<=$dmax); return $factors; } ?>

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.00418.33
8.3.50.0100.00721.92
8.3.40.0100.00718.84
8.3.30.0060.00918.73
8.3.20.0050.00318.65
8.3.10.0090.00020.63
8.3.00.0070.00021.94
8.2.180.0070.01116.38
8.2.170.0070.01022.96
8.2.160.0130.00720.55
8.2.150.0080.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0060.00321.06
8.2.110.0090.00022.10
8.2.100.0080.00417.72
8.2.90.0000.00919.11
8.2.80.0000.00918.09
8.2.70.0060.00317.25
8.2.60.0000.00817.80
8.2.50.0040.00418.10
8.2.40.0040.00417.91
8.2.30.0000.00721.27
8.2.20.0040.00417.52
8.2.10.0000.00817.46
8.2.00.0050.00317.50
8.1.280.0120.00625.92
8.1.270.0030.00523.99
8.1.260.0110.00426.35
8.1.250.0080.00028.09
8.1.240.0070.00322.09
8.1.230.0060.00617.77
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0030.00617.13
8.1.190.0000.00817.22
8.1.180.0030.00518.10
8.1.170.0080.00018.65
8.1.160.0000.00718.64
8.1.150.0040.00418.56
8.1.140.0000.00817.37
8.1.130.0070.00017.81
8.1.120.0050.00317.38
8.1.110.0030.00517.33
8.1.100.0000.00717.21
8.1.90.0030.00317.36
8.1.80.0000.00717.35
8.1.70.0000.00717.30
8.1.60.0060.00617.49
8.1.50.0000.00717.27
8.1.40.0040.00417.39
8.1.30.0000.00817.41
8.1.20.0050.00317.51
8.1.10.0040.00417.41
8.1.00.0050.00317.20
8.0.300.0070.00018.77
8.0.290.0060.00316.63
8.0.280.0040.00418.41
8.0.270.0050.00217.14
8.0.260.0030.00316.60
8.0.250.0050.00216.86
8.0.240.0040.00416.86
8.0.230.0000.00716.84
8.0.220.0070.00016.77
8.0.210.0040.00416.77
8.0.200.0000.00616.69
8.0.190.0050.00216.80
8.0.180.0050.00316.85
8.0.170.0060.00316.80
8.0.160.0000.00716.71
8.0.150.0040.00416.55
8.0.140.0000.00716.63
8.0.130.0000.00513.12
8.0.120.0000.00816.70
8.0.110.0030.00616.58
8.0.100.0040.00416.66
8.0.90.0030.00316.77
8.0.80.0030.01216.82
8.0.70.0040.00416.62
8.0.60.0040.00416.60
8.0.50.0050.00316.77
8.0.30.0080.01017.02
8.0.20.0150.00417.40
8.0.10.0000.00716.90
8.0.00.0130.00316.54
7.4.330.0000.00516.70
7.4.320.0030.00316.28
7.4.300.0000.00716.41
7.4.290.0030.00316.50
7.4.280.0000.00716.51
7.4.270.0000.00716.39
7.4.260.0000.00613.14
7.4.250.0050.00216.34
7.4.240.0030.00316.30
7.4.230.0000.00716.26
7.4.220.0210.00016.36
7.4.210.0060.01016.39
7.4.200.0030.00516.56
7.4.190.0000.00716.28
7.4.160.0030.01516.44
7.4.150.0110.00717.40
7.4.140.0170.00717.86
7.4.130.0080.01016.44
7.4.120.0140.00616.38
7.4.110.0000.01816.36
7.4.100.0110.00616.47
7.4.90.0100.01316.25
7.4.80.0080.01219.39
7.4.70.0080.01416.12
7.4.60.0060.01016.32
7.4.50.0040.00416.32
7.4.40.0070.00722.77
7.4.30.0120.00916.45
7.4.00.0030.01015.06
7.3.330.0050.00013.14
7.3.320.0050.00013.12
7.3.310.0000.00716.00
7.3.300.0040.00216.05
7.3.290.0100.01016.09
7.3.280.0090.00916.16
7.3.270.0080.00817.40
7.3.260.0100.00918.24
7.3.250.0080.01016.17
7.3.240.0060.01216.43
7.3.230.0120.00616.39
7.3.210.0100.00616.23
7.3.200.0060.01519.39
7.3.190.0060.00916.18
7.3.180.0080.00816.23
7.3.170.0090.00916.57
7.3.160.0000.01716.34
7.3.120.0080.00614.72
7.2.330.0030.01716.48
7.2.320.0090.00916.54
7.2.310.0100.01016.19
7.2.300.0060.01016.46
7.2.290.0080.00816.30
7.2.120.0030.00916.50
7.2.110.0060.00916.52
7.2.100.0000.01216.53
7.2.90.0070.00716.55
7.2.80.0030.01316.33
7.2.70.0080.00616.71
7.2.60.0060.00916.56
7.2.50.0060.00916.73
7.2.40.0110.00416.79
7.2.30.0100.00316.59
7.2.20.0030.01016.75
7.2.10.0060.00616.81
7.2.00.0040.01017.70
7.1.240.0080.00015.65
7.1.230.0100.00315.45
7.1.220.0000.01315.72
7.1.210.0080.00415.78
7.1.200.0080.00515.51
7.1.190.0040.00815.57
7.1.180.0090.00015.73
7.1.170.0070.00715.50
7.1.160.0070.00315.58
7.1.150.0090.00615.53
7.1.140.0070.00715.43
7.1.130.0060.00615.60
7.1.120.0070.01015.53
7.1.110.0070.00715.62
7.1.100.0040.00816.70
7.1.90.0030.01015.56
7.1.80.0040.01115.74
7.1.70.0050.00616.29
7.1.60.0060.01317.46
7.1.50.0090.01216.17
7.1.40.0000.01315.50
7.1.30.0000.01015.27
7.1.20.0030.01015.61
7.1.10.0030.00715.55
7.1.00.0070.03918.88
7.0.320.0050.00815.34
7.0.310.0000.01115.41
7.0.300.0060.00615.23
7.0.290.0040.00415.11
7.0.280.0100.00315.09
7.0.270.0080.00315.04
7.0.260.0050.00315.16
7.0.250.0060.00315.01
7.0.240.0030.01015.27
7.0.230.0000.01015.43
7.0.220.0070.00015.00
7.0.210.0030.01014.97
7.0.200.0030.00715.65
7.0.190.0050.00915.14
7.0.180.0030.01214.92
7.0.170.0030.00614.91
7.0.160.0050.00315.37
7.0.150.0070.00715.31
7.0.140.0070.03718.70
7.0.130.0000.01215.20
7.0.120.0040.01215.34
7.0.110.0100.00315.13
7.0.100.0070.00715.26
7.0.90.0090.00315.37
7.0.80.0000.01515.42
7.0.70.0080.00415.32
7.0.60.0050.04517.57
7.0.50.0000.04016.70
7.0.40.0100.02816.73
7.0.30.0150.02216.62
7.0.20.0150.02516.79
7.0.10.0060.04116.76
7.0.00.0070.04516.69
5.6.380.0100.00614.12
5.6.370.0030.00713.84
5.6.360.0080.00814.38
5.6.350.0030.00614.15
5.6.340.0070.00313.78
5.6.330.0040.00414.16
5.6.320.0110.00414.38
5.6.310.0040.00714.39
5.6.300.0000.00714.23
5.6.290.0090.00614.25
5.6.280.0060.03817.57
5.6.270.0030.01013.93
5.6.260.0070.00713.90
5.6.250.0070.00714.21
5.6.240.0000.01114.23
5.6.230.0030.00513.92
5.6.220.0040.00414.22
5.6.210.0060.04817.40
5.6.200.0070.03816.09
5.6.190.0020.02817.20
5.6.180.0230.04017.37
5.6.170.0190.02317.38
5.6.160.0060.03117.29
5.6.150.0030.02616.12
5.6.140.0070.02016.28
5.6.130.0050.04216.21
5.6.120.0060.03017.60
5.6.110.0060.04017.63
5.6.100.0050.04817.60
5.6.90.0100.01817.48
5.6.80.0060.02517.26
5.6.70.0060.00614.16
5.6.60.0030.01214.09
5.6.50.0070.00714.18
5.6.40.0040.00814.30
5.6.30.0110.00314.10
5.6.20.0090.00313.97
5.6.10.0090.00013.91
5.6.00.0040.01214.02
5.5.380.0000.01011.27
5.5.370.0060.00311.27
5.5.360.0000.00811.27
5.5.350.0200.03515.81
5.5.340.0080.04014.65
5.5.330.0110.03315.77
5.5.320.0170.04415.81
5.5.310.0160.02815.76
5.5.300.0050.03014.62
5.5.290.0060.02614.62
5.5.280.0050.03216.05
5.5.270.0020.03716.06
5.5.260.0070.03816.13
5.5.250.0060.03915.89
5.5.240.0060.03815.76
5.5.230.0000.01211.27
5.5.220.0040.00411.27
5.5.210.0030.00711.27
5.5.200.0080.00311.27
5.5.190.0000.01011.27
5.5.180.0000.00811.27
5.5.170.0090.00614.13
5.5.160.0110.00011.27
5.5.150.0080.00011.27
5.5.140.0080.00311.27
5.5.130.0030.00711.27
5.5.120.0060.00611.27
5.5.110.0030.00911.27
5.5.100.0030.00811.27
5.5.90.0070.00411.27
5.5.80.0000.00811.27
5.5.70.0080.00311.27
5.5.60.0030.00511.27
5.5.50.0090.00311.27
5.5.40.0060.00611.27
5.5.30.0000.00711.27
5.5.20.0030.00811.27
5.5.10.0080.00311.27
5.5.00.0060.00611.27
5.4.450.1780.02615.22
5.4.440.1630.02315.39
5.4.430.1650.02015.34
5.4.420.1610.01815.23
5.4.410.1780.01815.28
5.4.400.1750.02115.16
5.4.390.1800.02015.12
5.4.380.1620.02615.05
5.4.370.1740.02015.18
5.4.360.1830.02315.21
5.4.350.1750.01915.11
5.4.340.1950.03215.07
5.4.330.0060.00311.27
5.4.320.1680.02115.29
5.4.310.1700.01815.20
5.4.300.2010.02615.16
5.4.290.1730.02615.22
5.4.280.1500.02315.24
5.4.270.1750.02215.12
5.4.260.2020.02215.17
5.4.250.1820.02215.05
5.4.240.1880.01815.29
5.4.230.1820.01915.29
5.4.220.1840.02215.21
5.4.210.1620.02115.24
5.4.200.1750.02315.23
5.4.190.1790.01815.04
5.4.180.1720.01915.06
5.4.170.1650.02015.06
5.4.160.1750.02315.28
5.4.150.1770.02415.04
5.4.140.1770.02213.88
5.4.130.1770.01813.86
5.4.120.1770.02413.82
5.4.110.1800.02313.85
5.4.100.1800.01913.86
5.4.90.1660.01813.87
5.4.80.1550.02113.91
5.4.70.1750.02313.90
5.4.60.1750.02113.83
5.4.50.1700.02013.75
5.4.40.1730.02213.89
5.4.30.1750.02213.72
5.4.20.1700.02413.84
5.4.10.1770.02313.91
5.4.00.1780.02413.52
5.3.290.1830.01813.03
5.3.280.1820.01712.98
5.3.270.1720.02013.01
5.3.260.1870.01712.94
5.3.250.1770.02212.98
5.3.240.1800.02712.97
5.3.230.1670.02312.94
5.3.220.1970.02512.95
5.3.210.1780.02512.88
5.3.200.1900.01812.88
5.3.190.1820.02112.91
5.3.180.1720.01812.92
5.3.170.1730.02312.88
5.3.160.1730.02112.91
5.3.150.1730.02212.87
5.3.140.2030.02312.95
5.3.130.1930.02412.91
5.3.120.1960.02012.87
5.3.110.1690.02212.86
5.3.100.1820.01812.65
5.3.90.1780.01812.61
5.3.80.1870.01312.65
5.3.70.1680.02012.63
5.3.60.1780.02212.60
5.3.50.2040.02012.63
5.3.40.1620.02012.68
5.3.30.1580.01712.56
5.3.20.1580.01812.44
5.3.10.1650.02312.42
5.3.00.2020.02212.46
5.2.170.1380.02011.25
5.2.160.1440.01211.21
5.2.150.1460.01811.17
5.2.140.1150.01811.20
5.2.130.1430.01511.25
5.2.120.1430.01711.18
5.2.110.1250.02011.23
5.2.100.1420.01411.23
5.2.90.1490.02011.19
5.2.80.1580.01311.24
5.2.70.1420.01511.23
5.2.60.1650.02111.12
5.2.50.1460.01611.12
5.2.40.0980.01811.18
5.2.30.0990.02111.10
5.2.20.1220.01511.08
5.2.10.1180.01511.02
5.2.00.1370.02011.02
5.1.60.1250.01210.67
5.1.50.1170.01310.75
5.1.40.1320.01310.63
5.1.30.1250.01710.79
5.1.20.1270.01310.79
5.1.10.1190.01210.67
5.1.00.1330.01810.70
5.0.50.0770.0139.87
5.0.40.0620.0089.79
5.0.30.0770.0139.70
5.0.20.0630.0129.73
5.0.10.0580.0129.75
5.0.00.0570.0189.66
4.4.90.0720.0108.87
4.4.80.0650.0128.87
4.4.70.0600.0078.87
4.4.60.0650.0138.87
4.4.50.0710.0108.87
4.4.40.0650.0158.87
4.4.30.0620.0088.87
4.4.20.0700.0128.87
4.4.10.0700.0108.87
4.4.00.0770.0128.87
4.3.110.0740.0108.87
4.3.100.0730.0088.87
4.3.90.0650.0078.87
4.3.80.0710.0158.87
4.3.70.0580.0088.87
4.3.60.0680.0118.87
4.3.50.0780.0108.87
4.3.40.0620.0168.87
4.3.30.0360.0158.87
4.3.20.0320.0128.87
4.3.10.0380.0158.87
4.3.00.0320.0128.87

preferences:
46.69 ms | 401 KiB | 5 Q