title: Potentially write to same file in PHP multiple times at once?
body: <p>I am using PHP's <code>fputcsv</code> to log votes in an application we are making. The saving part of my code roughly ressembles this:</p>
  
  <pre><code>$handle = fopen('votes.csv', 'a');
  fputcsv($handle, $data);
  fclose($handle);
  </code></pre>
  
  <p>This works flawlessly in tests. However, I have a small concern. When deployed in production, it's possible that many many users will be making a request to this script at the same time. I am curious as to how PHP will handle this.</p>
  
  <p>Will I potentially have problems, and lose votes because of that? If so, what can I do to prevent it? Is the solution more complex than simply using a database? And finally, how can I test for this situation, where a lot of requests would be made at the same time? Are there things that already exist to test this sort of stuff?</p>