fwrite将书面内容加倍

I'm trying to write a php variable inside another php file.

My writing content is:

$writeValue = "\$Var['".$this->js_checksum."'] = '".serialize($log_content)."';";

and I'm using Joomla $stream->write($content); 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 $var, identically, so basically the server writes the variable two times. If I change $writeValue = "a"; then the server is writing it only once, as it should.

I can't figure it out why?