What are the advantages and disadvantages of using __autoload for automatic class loading in PHP?

Using __autoload for automatic class loading in PHP can help streamline the process of including class files when they are needed, reducing the need for manual include statements throughout your code. However, it can also lead to potential conflicts if multiple autoload functions are registered, and it may not be as efficient as using a more modern autoloading solution like spl_autoload_register.

// Example of using __autoload for automatic class loading in PHP
function __autoload($class) {
    require_once 'classes/' . $class . '.php';
}

// Usage example
$obj = new MyClass();