title: PHP stops executing after specific amount of recursion loops
body: <p>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.</p>
  
  <p>Everything works when calling a function recursively under ~21 000 times. The problem occurs when exeeding this number.</p>
  
  <p>My working code:</p>
  
  <pre><code>foo();
  
  function foo($i = 1) {
      if ($i &gt; 20000) {
           return;
      }
      echo $i . '&lt;br/&gt;';
      foo($i + 1);
  
      return;        
  }
  </code></pre>
  
  <p>Outputs: <br>...<br>19998<br>19999<br>20000<br></p>
  
  <p>Not working code:
      
  
  <pre><code>foo();
  
  function foo($i = 1) {
      if ($i &gt; 30000) {  // Or any number above ~21000
           return;
      }
      echo $i . '&lt;br/&gt;';
      foo($i + 1);
  
      return;        
  }
  </code></pre>
  
  <p>Outputs: <br>...<br>13493<br>13494<br>13<br><br>Last row stops in the middle of the number.
  In some cases it just sends an empty response to the server.</p>
  
  <p>I am using apache2 server on Ubuntu with PHP Version 5.6.10. Using Xampp, same problem occurs, only numbers are a little different.</p>