Get a list of all loaded files

10. 04. 2021

When debugging more complex applications, it sometimes happens that I don't know what all files have been loaded and if something is missing.

If you use Composer or any other kind of class autoloading, you probably don't know this problem. However, it can be a relatively common occurrence when debugging older applications from other developers.

Getting all the loaded files can be done with the get_included_files() function, which returns them as an array of absolute path strings.

It is common in development to have a huge number of files loaded (for example, even this relatively simple blog uses almost 160 files). Most of the time, though, the large volume doesn't matter, because the contents of the files are retrieved from OPCache, which is optimized for bulk reads.

Jan Barášek   Více o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Související články