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; } ?>
Output for git.master, git.master_jit, rfc.property-hooks

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
36.58 ms | 401 KiB | 8 Q