You need to register startup features spl_autoload_register. You need to provide a "callable" . The most enjoyable way to do this, starting at 5.3, is with an anonymous function:
spl_autoload_register(function($class) {
include 'classes/' . $class . '.class.php';
});
The main advantage of this method against __autoloadis, of course, multiple calls spl_autoload_register, while __autoload(like any function) can be defined only once. If you have modular code, this will be a significant drawback.
2018 : , . (PSR-4) . Composer.