title: Apache Connection Reset with preg_split
body: <p>I'm facing a very weird behavior with Apache/2.2.25 (Win32) and PHP/5.4.10,</p>
  
  <p>I have this code</p>
  
  <pre><code>$content = &lt;&lt;&lt;EOF
  &lt;UNICODE-WIN&gt;
  &lt;Version:7&gt;&lt;FeatureSet:InDesign-R2L&gt;&lt;ColorTable:=&lt;Black:COLOR:CMYK:Process:0,0,0,1&gt;&gt;
  &lt;DefineCharStyle:Character Style 1=&lt;Nextstyle:Character Style 1&gt;&lt;cTypeface:Bold Italic&gt;&lt;cSize:19.000000&gt;&lt;cCase:All Caps&gt;&lt;cPosition:Normal&gt;&lt;cKashida:Default&gt;&gt;
  &lt;DefineParaStyle:Paragraph Style 1=&lt;Nextstyle:Paragraph Style 1&gt;&lt;cTypeface:Bold Italic&gt;&lt;cCase:All Caps&gt;&gt;
  &lt;DefineParaStyle:NormalParagraphStyle=&lt;Nextstyle:NormalParagraphStyle&gt;&gt;
  &lt;ParaStyle:Paragraph Style 1&gt;&lt;CharStyle:Character Style 1&gt;Text Sample Text Sample Text Sample
  &lt;CharStyle:&gt;&lt;ParaStyle:Paragraph Style 1&gt;
  &lt;ParaStyle:NormalParagraphStyle&gt;&lt;CharStyle:Character Style 1&gt;
  &lt;CharStyle:&gt;&lt;ParaStyle:NormalParagraphStyle&gt;Text Sample Text Sample Text Sample Text Sample .
  &lt;CharStyle:&gt;&lt;ParaStyle:NormalParagraphStyle&gt;aa aaaaa aaaa  \\\&lt;bbbbbbb\\\\\&gt;cccccc
  &lt;ParaStyle:NormalParagraphStyle&gt;
  Text Sample Text Sample Text Sample Text Sample Text Sample Text Sample
  &lt;ParaStyle:NormalParagraphStyle&gt;&lt;CharStyle:Character Style 1&gt;Text Sample
  &lt;CharStyle:&gt;&lt;ParaStyle:NormalParagraphStyle&gt;
  Text Sample Text Sample Text Sample Text Sample Text Sample
  &lt;ParaStyle:NormalParagraphStyle&gt;Text Sample Text Sample Text Sample Text Sample
  &lt;ParaStyle:NormalParagraphStyle&gt;&lt;CharStyle:Character Style 1&gt;&lt;cNextXChars:Column&gt;
  &lt;CharStyle:&gt;&lt;ParaStyle:NormalParagraphStyle&gt;&lt;cNextXChars:Column&gt;
  &lt;ParaStyle:NormalParagraphStyle&gt;Text Sample Text Sample
  &lt;ParaStyle:NormalParagraphStyle&gt;
  EOF;
  $regex         = '/((&lt;(([^&lt;&gt;]|&lt;[^&lt;&gt;]*&gt;)*)&gt;\s*)+)/s';
  $parts         = preg_split( $regex, $content, null, PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_NO_EMPTY );
  </code></pre>
  
  <p>And for some reason when I execute this code it results in connection reset page in the browser, no error log in Apache or PHP</p>
  
  <p>Did some research online but could not find good solution for it, </p>
  
  <p>Here's a link of the <a href="http://comstrike.com/01-phpinfo.html" rel="nofollow">results of phpinfo page on the Windows server</a></p>
  
  <p>Also please ntoe that I run the same code on other servers Windows and CentOS and it works just fine</p>
  
  <p>Appreciate your help</p>