clearstatcache()
clearstatcache - Clears file status cache
Syntax
clearstatcache (
bool $clear_realpath_cache,
string $filename)
Arguments
- clear_realpath_cache - Whether to clear the realpath cache or not.
- filename - Clear the realpath cache for a specific filename; only used if clear_realpath_cache is TRUE.
Description
When you use stat(), lstat(), or any of the other functions listed in the affected functions list (below), PHP caches the information those functions return in order to provide faster performance. However, in certain cases, you may want to clear the cached information. For instance, if the same file is being checked multiple times within a single script, and that file is in danger of being removed or changed during that script's operation, you may elect to clear the status cache. In these cases, you can use the clearstatcache() function to clear the information that PHP caches about a file.
Version
PHP 4, 5
Return value
No value is returned.