title: Echoing large string in PHP results in no output at all
body: <p>I am helping to build a Joomla site (using Joomla 1.5.26). One of the pages are really really big. As a result, PHP just stops working without any error and all previously printed strings are ignored. There is no output at all. We have display_errors set to TRUE and error_reporting set to E_ALL. </p>
  
  <p>I found the exact line where PHP breaks. It's in libraries/joomla/application/component/view.php:196</p>
  
  <pre><code>function display($tpl = null)
  {
      $result = $this-&gt;loadTemplate($tpl);
      if (JError::isError($result)) {
          return $result;
      }
  
      echo $result;
  }
  </code></pre>
  
  <p>Some information:</p>
  
  <ul>
  <li>Replacing echo $result; with echo strlen($result); works. The length of the string is 257759.</li>
  <li>echo substr($result, 0, 103396); is printing partial content.</li>
  <li>echo substr($result, 0, 103397); results in no output at all.</li>
  <li>echo substr($result, 0, 103396) . "A"; results in no output at all. So splitting string into chunks is not a solution. </li>
  </ul>
  
  <p>I have checked server performance during the execution of the script. CPU usage is 100% but there's plenty of memory left. PHP memory limit is 1024M. output_buffering is 4096 but I tried setting it to unreasonably high number - dies at exact same position. Server runs Apache 2.2.14-5ubuntu8.10 and PHP 5.3.2-1ubuntu4.18. PHP runs as fast_cgi module.</p>
  
  <p>I have never experienced something like that and Google search results in nothing also. Have any of you experienced something like that and know the solution?
  Thanks for reading!</p>