This problem only exists with EasyPHP 1.8.
I wrote this program along time ago and I realize my style was very poor.
The program takes an integer ($num) and prime factors it. The numbers 15999 and 2702811 cause the server to crash (apperantly) immediately.
<?php
print("Start of program");
$num = 15989;
$startnum = 1;
if($num == 1){
print("1 has no factors");
exit;
}
if($num == 0){
print("0 has no factors");
exit
}else{
print("The factors of ".$num." are:<br />");
}
primefind($num, $startnum);
if($num == 0){
print("0");
}
else if($num == 1){
print("1");
}else{
}
function primefind($num, $startnum){
$primestat = 'f';
for($counter1 = $startnum; $counter1<=$num; $counter1++){
for($counter2 = 2; $counter2<$counter1; $counter2++){
$primecheck = $counter1%$counter2;
if($primecheck != 0){
$primestat = 't';
}else{
$primestat = 'f';
break;
}
}
if($primestat == 't'||$counter1 == 2){
factorcheck($counter1, $num);
break;
}
}
}
function factorcheck($prime, $num){
$remainder = $num%$prime;
if($remainder == 0)
{
print($prime.'<br />');
$startnum = 1;
primefind(($num/$prime), $startnum);
//exit;
return $prime;
}
else{
$prime++;
primefind($num, $prime);
}
}
?>