title: filesize() : giving incorrect result
body: <p>I am testing out a tool for modifying files and one fairly important ability during this is telling the file size, especially while the file is still open.</p>
  
  <pre><code>$file = tempnam('/tmp', 'test_');
  file_put_contents($file, 'hello world');
  
  echo 'Initial Read: ' . file_get_contents($file).PHP_EOL;
  
  echo 'Initial Size: ' . filesize($file).PHP_EOL;
  
  $fp = fopen($file, 'a');
  fwrite($fp, ' then bye');
  
  echo 'Final Read:   ' . file_get_contents($file).PHP_EOL;
  
  fclose($fp);
  echo 'Final Size:   ' . filesize($file).PHP_EOL;
  </code></pre>
  
  <p>This simple script is giving some strange results:</p>
  
  <pre><code>Initial Read: hello world
  Initial Size: 11
  Final Read:   hello world then bye
  Final Size:   11
  </code></pre>
  
  <p>I thought the final size would have been the result of the file still being open which is why I added the <code>fclose($fp);</code>, however this made no difference.  Either way I need to be able to determine the size while the file is still open.</p>
  
  <p>The final size should be 20.  Does anyone know the possible cause of this and how to work around it?</p>