PHP Mailer数组错误

Having an annoying error with PHPMailer and can't figure what it's for

Mails send fine with it, but I get this:

Warning: in_array() expects parameter 2 to be array, boolean given in /dir/class.phpmailer.php on line 574

Any idea's?

CODE:

if (!in_array('PHPMailerAutoload', spl_autoload_functions())) {
  require 'PHPMailerAutoload.php';
  }

class.phpmailer.php is 2000+ lines long, obviously I can't paste it all

It looks like your spl autoload is empty, that's why it returns a boolean, false. http://php.net/manual/en/function.spl-autoload-functions.php

Try the following:

if (!spl_autoload_functions() OR (!in_array('PHPMailerAutoload', spl_autoload_functions()))) {
  require_once('PHPMailerAutoload.php');
}

Your spl_autoload_functions() returns boolean not array.

It should be an array.

See documentation of spl_autoload_functions:

If the autoload stack is not activated then the return value is FALSE.

You need to check this first.

Folks should go a bit easy on OP... this is an error in the PHPMailer code, not in the OP's code. The accepted answer is a solution for fixing the PHOMailer IITB code. Thanks for answering it Michal-sk!