Experience Level: Beginner to Intermediate PHP
In this tutorial – published Dec. 14, 2018 – Justin Tadlock provides a rich introduction to basic namespacing and autoloading best practices.
- Introduction to namespaces in PHP 5.3+
- Declaring and aliasing (importing) namespaced classes and functions
- Introduction to autoloaders and tips on organizing project files to match namespace structure
- Composer and custom autoloadersIntroduction to using autoloaders with Composer
- Custom autoloader example
This post contains a wealth of great information and is written by a well-respected member of the WordPress development community, an excellent combination.