title: __autoload() is no longer supported, use spl_autoload_register() instead in C:\xampp\htdocs\webapp\PHPMailerAutoload.php on line 45
body: <p>I use phpMailer for the processing of mail sent from the website. This morning I suddenly got the following message:</p>
  <blockquote>
  <p>Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in C:\xampp\htdocs\webapp\PHPMailerAutoload.php on line 45</p>
  </blockquote>
  <p>I have PHP 8.0.0 running on the server</p>
  <pre><code>if (version_compare(PHP_VERSION, '5.1.2', '&gt;=')) {
      //SPL autoloading was introduced in PHP 5.1.2
      if (version_compare(PHP_VERSION, '5.3.0', '&gt;=')) {
          spl_autoload_register('PHPMailerAutoload', true, true);
      } else {
          spl_autoload_register('PHPMailerAutoload');
      }
  } else {
      /**
       * Fall back to traditional autoload for old PHP versions
       * @param string $classname The name of the class to load
       */
      function __autoload($classname)
      {
          PHPMailerAutoload($classname);
      }
  }
  </code></pre>