On Friday, February 6, 2004, 6:44:52 AM, Nuno wrote:
> nlopess Thu Feb 5 14:44:52 2004 EDT
> Modified files:
> /phpdoc/en/reference/filesystem/functions clearstatcache.xml
> Log:
> fix #27134
> php dont cache info about non-existent files
<snip>
> + <para>
> + You should also note that PHP don't cache information about non-existent
> + files. So, if you call <function>file_exists</function> on a file that
> + doesn't exist, it will return &false; untill you create the file. If you
> + create the file, it will return &true; even if you then delete the file.
> + </para>
> <note>
> <para>
> This function caches information about specific filenames, so you only
"If you create the file, it will return &true; even if you then delete
the file". Are you sure?
<?php
var_dump(file_exists('temp.txt'));
touch('temp.txt');
var_dump(file_exists('temp.txt'));
unlink('temp.txt');
var_dump(file_exists('temp.txt'));
?>
Outputs:
bool(false)
bool(true)
bool(false)
for me, on PHP 4.3.4RC1 (cgi) (yeah I know, I need to upgrade :P).
"PHP don't cache information", should also be "PHP doesn't cache
information", or "PHP does not cache information".
Dave