title: Difference between return value of non-blocking flock function and the $wouldblock argument?
body: <p>I'm trying to understand non blocking <a href="http://php.net//manual/en/function.flock.php" rel="noreferrer">flock</a> and the wouldblock argument</p>
  
  <pre><code>$fp = fopen('/tmp/lock.txt', 'r+'); 
  if(flock($fp, LOCK_EX | LOCK_NB, $wouldblock)) {
    echo 'Lock obtained';
  }
  else{
    echo 'Unable to obtain lock';
  }
  fclose($fp);
  </code></pre>
  
  <p>Documentation says about wouldblock:</p>
  
  <blockquote>
    <p>The optional third argument is set to 1 if the lock would block (EWOULDBLOCK errno condition). </p>
  </blockquote>
  
  <p>Reproducing in a test enviroment the concurrent condition, if another process has gained lock, the flock function will immeditatly return FALSE (non blocking)</p>
  
  <p>So why should I care about <strong>$wouldblock</strong> value if the return value of flock function in non-blocking mode allready tells me that the lock couldn't be obtained?</p>
  
  <p>I can't get the difference between flock function returning FALSE and the $wouldblock argument setted to 1, and what the $wouldblock argument is usefull for.</p>