title: Using Namespaces with spl_autoload_register
body: <pre><code>use PHPMailer\PHPMailer\PHPMailer;  
  
  require_once &quot;PHPMailer/PHPMailer.php&quot;;  
  
  $mail = new PHPMailer(true);
  </code></pre>
  <p>This works great.
  But when I try to autoload the classes using spl_autoload_register i get a
  Warning: require_once(PHPMailer/PHPMailer\PHPMailer\PHPMailer.php): failed to open stream: No such file or directory</p>
  <pre><code>use PHPMailer\PHPMailer\PHPMailer;
  
  spl_autoload_register(function($class){
      require_once 'PHPMailer/' . $class . '.php';
  });
  
  $mail = new PHPMailer(true);`
  </code></pre>
  <p>I'm a bit confused since the autoloader now requires the full path to the PHPMailer class in the PHPMailer/PHPMailer namespace.</p>