I have a PHP code which includes several files if they exists. It might be 150 files to include.

Is it slow to use file\_exists in this case? Should I build an array to create a cache of the file structure instead?

Is there other ways to make some kind of cache of the file structure?