PHP Autoloading

In order to instantiate a PHP class defined in a separate file, that file must be included or required into the file currently being executed.

Using include_once(), require() or any other variation to pull-in class files will work, but it will not scale well if the app adds features and or libraries. With this pattern new include lines must be added to this file every time a new class is added anywhere in the app.

If you are using good PHP coding practices, the file and path names for your app should directly match the namespaces and class names of the application.