The problem which I encounter is very odd. It happens when doing recursion loops. It doesn't happen when doing the same task using for loop or any other iteration.
Everything works when calling a function recursively under ~21 000 times. The problem occurs when exeeding this number.
My working code:
foo();
function foo($i = 1) {
if ($i > 20000) {
return;
}
echo $i . '<br/>';
foo($i + 1);
return;
}
Outputs:
...
19998
19999
20000
Not working code:
foo();
function foo($i = 1) {
if ($i > 30000) { // Or any number above ~21000
return;
}
echo $i . '<br/>';
foo($i + 1);
return;
}
Outputs:
...
13493
13494
13
Last row stops in the middle of the number.
In some cases it just sends an empty response to the server.
I am using apache2 server on Ubuntu with PHP Version 5.6.10. Using Xampp, same problem occurs, only numbers are a little different.