New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPMailerAutoload.php: PHP Deprecated: __autoload() is deprecated, use spl_autoload_register() instead #569
Comments
Strange. That function is only added if the version is below 5.1.2 so you should never get that notice. Can you tell me the output of this PHP script on your system?
BTW we can't upgrade to PHPMailer 6 just yet since it requires PHP 5.5. |
What output? The PHPMailer caused the error message above. The emails went out, as far as I noticed. PHP is 7.2. |
I mean can you make a PHP script on your site with the code I posted above and let me know what you see? For example you should see something like:
The only reason I can think of why you're getting that notice is because there is some problem with the |
Managed to reproduce this on PHP 7.2. Strangely, for me the notice appears only the first page load, then it never appears again until I restart the server. Might be a bug in PHP itself. Probably the easiest thing to do is just remove the autoload bit manually from our PHPMailer copy. |
Exactly what I did, removing the autoload. Weird PHP behavior. |
I checked with the PHP devs and this is apparently intended behaviour. The notice is generated during the code 'parsing' phase, regardless of whether that part of the code is executed. Anyway, the PHPMailer autoloader doesn't do much - we only need 2 PHP files. So I've removed it and included the classes manually. |
Getting this within my error logs:
Should
function __autoload($classname)
be removed? Guess there is nearly noone using a version below PHP 5.1.2.PS: There is already PHPMailer 6 available: https://github.com/PHPMailer/PHPMailer/releases
The text was updated successfully, but these errors were encountered: