title: Mutually exclusive flags on file_put_contents?
body: <p>On the <a href="http://php.net/file-put-contents" rel="nofollow noreferrer">file_put_contents</a>() documentation, it says the following:</p>
  
  <p><strong>FILE_APPEND</strong>:</p>
  
  <blockquote>
    <p>Mutually exclusive with LOCK_EX since
    appends are atomic and thus there is
    no reason to lock.</p>
  </blockquote>
  
  <p><strong>LOCK_EX</strong>:</p>
  
  <blockquote>
    <p>Mutually exclusive with FILE_APPEND.</p>
  </blockquote>
  
  <p>Yet, a couple of lines bellow I see the following code:</p>
  
  <pre><code>&lt;?php
  $file = 'people.txt';
  // The new person to add to the file
  $person = "John Smith\n";
  // Write the contents to the file, 
  // using the FILE_APPEND flag to append the content to the end of the file
  // and the LOCK_EX flag to prevent anyone else writing to the file at the same time
  file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
  ?&gt;
  </code></pre>
  
  <p>So, are the FILE_APPEND and LOCK_EX flags mutually exclusive or not? If yes, why do they use it in the example? Is this a case of bad documentation?</p>
  
  <p>Thanks for your input!</p>