class per file require_once(‘classes/user.class.php’); require_once(‘classes/page.class.php’); require_once(‘classes/role.class.php’); require_once(‘classes/db.class.php’); // ...
Don’t throw errors/exceptions if a file doesn’t exist. Let the other autoloaders try. • Don’t use the __autoload() function. • Use Composer’s autoloader. ◦ You don’t have to write your own ◦ It already follows the PSR autoloading standards