I was running this simple math test on my localhost:
$r = [1,2,3,4,5,6,7,8,9];
$result = FALSE;
while($result == FALSE){
if(
$r[0] + $r[1] - $r[2] == 4 &&
$r[3] - $r[4] + $r[5] == 8 &&
$r[6] * $r[7] - $r[8] == 8 &&
$r[0] + $r[3] - $r[6] == 6 &&
$r[1] * $r[4] - $r[7] == 2 &&
$r[2] + $r[5] - $r[8] == 6){
$result = TRUE;
echo "<pre>";
echo print_r($r);
echo "</pre>";
} else {
shuffle($r);
}
}
If run that exact code on phpfiddle.org I get an instant result of that equation, but if I run on my locahost it gets to point of giving me a max execution timeout (120).
I believe my PC is not the problem, I have good specs, Core I5, 8GB ram, etc, So i believe that there is something wrong with my Wamp PHP configuration that its making the problem.
Funny enough, if i refresh the browser a couple of times it gives me the result at the speed of the click.
How can I troubleshoot this?