title: fwrite doubles the written content
body: <p>I'm trying to write a php variable inside another php file.</p>
  
  <p>My writing content is:</p>
  
  <pre><code>$writeValue = "\$Var['".$this-&gt;js_checksum."'] = '".serialize($log_content)."';";
  </code></pre>
  
  <p>and I'm using Joomla <code>$stream-&gt;write($content);</code> to write this content into another php page.
  The problem is that I'm getting, inside the php page after the writing process is done, double <code>$var</code>, identically, so basically the server writes the variable two times.
  If I change <code>$writeValue = "a";</code> then the server is writing it only once, as it should.</p>
  
  <p>I can't figure it out why?</p>