title: What is the PHP manual talking about with clearstatcache()?
body: <blockquote>
  <p>You should also note that PHP doesn't cache information about non-existent files. So, if you call file_exists() on a file that doesn't exist, it will return false until you create the file. If you create the file, it will return true even if you then delete the file. However unlink() clears the cache automatically.</p>
  </blockquote>
  <p>Source: <a href="https://www.php.net/manual/en/function.clearstatcache.php" rel="nofollow noreferrer">https://www.php.net/manual/en/function.clearstatcache.php</a></p>
  <p>I've read this numerous times but simply cannot make any sense of it. What is the actual information it's trying to convey?</p>
  <p>To me, it sounds as if it's contradicting itself. First it says that PHP doesn't cache information about non-existent files. Then it goes on to state that it will return <code>true</code> even if you delete the file. But also that <code>unlink()</code> clears the cache automatically.</p>
  <p>Is it referring to the file being deleted outside of PHP? Isn't that the only thing it can mean? But the way it's put is so incredibly confusing, ambiguous and weird. Why even mention that <code>file_exists()</code> will return <code>false</code> until you create the file? It's like saying that water will remain wet even if you clap your hands.</p>
  <p>Is it actually saying, in a very round-about way, that I have to always run <code>clearstatcache()</code> before <code>file_exists()</code> unless I want a potentially lying response because a non-PHP script/program has deleted the file in question after the script was launched?</p>
  <p>I swear I've spent half my life just re-reading cryptic paragraphs like this because they just don't seem to be written by a human being. I've many, many times had to ask questions like this about small parts of various manuals, and even then, who knows if your interpretations are correct?</p>