Since this is so specific, it would probably have been better asked on Github, but I'll answer it here.
This was done for a very specific reason; switching to variable functions (which was done in PHPMailer 6.1.2) caused a very specific BC break in PHP versions between 5.2.3 and 7.0.0, and that was reported to me. While those PHP versions are now considered defunct, many are still using them, and the current PHPMailer release (6.x) promises compatibility back to PHP 5.5, so this change needed be reverted to retain compatibility with those old versions. It has no effect on later PHP versions.
I originally changed to variable functions because, as you say, it's the new shiny, it's easier to read (IMHO), and it's the kind of thing that gets recommended by static analysers, however these (evidently!) don't take backward compatibility into account.
So what was the BC break? While variable functions themselves have been around for a while (since at least PHP 5.4 I think), the static method callable pattern (class::method
) was only added in PHP 7.0.0, whereas that syntax works fine incall_user_func
; that's exactly what the BC break was, and the reason for the reversion in the PHPMailer 6.1.7 release.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.