php cache expiration time for file_exists() or similiar functions
<p>as per php documentation for <a href="http://php.net/manual/en/function.file-exists.php" rel="nofollow">file_exists()</a></p>

<blockquote>
  <p>The results of this function are cached. See clearstatcache() for
  more details.</p>
</blockquote>

<p>But it doesn't provide information for how long php will hold this information in cache. I've checked documentation for <a href="http://php.net/manual/en/function.clearstatcache.php" rel="nofollow">clearstatcache()</a>
but no such information is there. Googling also not helped this time.</p>

<p>I'm building an application where file_exists is called to generate some output, and since the file being checked can be removed by any time by any user, i need to be sure if it really exists before generating output.</p>

<p>Calling clearcache() before file_exists() will solve the purpose, but just for curiosity I'd like to know for how long PHP will cache files information (default time) and by which variable i can this change cache expiration time?</p>

<p><strong>EDIT 1:</strong> In real, checking again with file_exists() after deleting file returns false, but if it is so, what is the meaning of cache as written in documentation ?</p>

<p><strong>EDIT 2:</strong> </p>

<pre><code>&lt;? 
var_dump(file_exists('/home/user/filecheck.php')); 
sleep(20);
// after running script, sleep for 20 seconds just to quickly delete this file manually before file_exists is called again.
// unlink is not used since as per documentation it'll clear php cache.
var_dump(file_exists('/home/user/filecheck.php')); 
?&gt;
</code></pre>

<p>and the response of script is </p>

<pre><code>boolean true

boolean false
</code></pre>

<p>That means php is not caching file_exists information if file exists even for same execution, then why it is written in documentation that "the results of this function are cached"? </p>