The question is quite simple: when it comes to touching the disk, are these two examples equal or is scenario 2 touching the disk twice?
Scenario number 1
include '/path/to/file.php';
Scenario number 2
if (file_exists('/path/to/file.php')) include '/path/to/file.php';
I know that scenario number 1 touches the disk once. Now, as I understand it, file_exists() caches the path and whether the file exists. To clear this cache, you need to call clearstatcache() .
But does it use include , etc. is this cache? Or is it exclusive to file_exists() ?
source share