There is a directory with subdirectories that you need to go through and perform certain actions for them:
while($dir = readdir($heandler)){ // где $heandler - родительская директория if(!is_file($dir)){ // какие-то действия } } So: for one of the folders is_file stubbornly returns true . I don't even know how to diagnose a problem. I watched the output of ls -la - the same output for all directories, so I think the problem is not in the OS. clearstatcache does not help, but renaming a directory solves the problem, only this option does not suit me (the folder is the yii module, too many paths have to be changed).