title: PHP: clearstatcache() not working
body: <p>My workflow is pretty simple:</p>
  
  <ol>
  <li>I delete a file</li>
  <li>I call <code>clearstatcache()</code></li>
  <li>I save a new file</li>
  <li>I call <code>clearstatcache()</code></li>
  </ol>
  
  <p>Still, at the end, <code>is_file()</code> returns <code>false</code> for a while before deciding to return <code>true</code> when i refresh 10sec later for example.</p>
  
  <p>It looks like a cache problem, doesn't it?</p>
  
  <p>Here's a piece of my code:</p>
  
  <pre><code>// step 1
  $path = 'file_to_delete.jpg';
  unlink($path);
  
  // is_file($path) returns false here -- normal behavior
  // step 2
  clearstatcache();
  
  // step 3 -- some stuff going on on an uploaded image, that leads to:
  imagejpeg($imagetosave, $path, 80);
  
  // step 4
  clearstatcache();
  
  // is_file() returns false, i have to wait a couple of seconds before it starts returning true
  </code></pre>
  
  <p>Thank you for your help!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Given all the answers i had, the problem doesn't <strong><em>seem</em></strong> to come from <code>clearstatcache()</code>.</p>
  
  <p>But should i add, when i overwrite the file (thus its <em>existing</em> status doesn't change), <code>is_file()</code> returns the good result. but when its <em>existing</em> status actually changes, the problem happens. It would be weird if the error didn't come from <code>clearstatcache()</code>, right? (or something related to this cache indeed)</p>