title: append to text file duplicate content
body: <p>working on windows 10 php 7.0.29</p>
  
  <p>if I run this snippet fo write a new text file</p>
  
  <pre><code>$myfile = fopen("/tmp/newfile.txt", "w") or die("Unable to open file!");
  $txt = "John Doe".PHP_EOL;
  fwrite($myfile, $txt);
  $txt = "Jane Doe".PHP_EOL;
  fwrite($myfile, $txt);
  fclose($myfile);
  die(__FILE__);
  </code></pre>
  
  <p>every thing it is ok</p>
  
  <h2>file content</h2>
  
  <p>John Doe</p>
  
  <h2>Jane Doe</h2>
  
  <p>but if I run it in append mode on a new file again</p>
  
  <pre><code>$myfile = fopen("/tmp/newfile.txt", "a") or die("Unable to open file!");
  $txt = "John Doe".PHP_EOL;
  fwrite($myfile, $txt);
  $txt = "Jane Doe".PHP_EOL;
  fwrite($myfile, $txt);
  fclose($myfile);
  die(__FILE__);
  </code></pre>
  
  <h2>file content is duplicated</h2>
  
  <p>John Doe
  Jane Doe
  John Doe
  Jane Doe
  John Doe</p>
  
  <h2>Jane Doe</h2>
  
  <p>I id all tests I can image but I can not append to a file</p>
  
  <p>Any suggestion ?
  Thanks</p>
  
  <h2>UPDATE</h2>
  
  <p>if I run the same snippet from shell it is ok</p>