For a few weeks, the WordPress Dashboard has been reminding me to upgrade to WordPress 5.2. So, I finally decided to upgrade but then I found out there was a new requirement: PHP 5.6.20. My web server was running PHP 5.4.45. So, I contacted HostGator (Capitalware’s hosting company) about upgrading PHP. They said they could upgrade it to PHP 7. I checked WordPress’s site and it said they support it. So, I gave the go ahead for the PHP upgrade then I upgrade WordPress to 5.2 Everything look good, as far as WordPress and plugins were concerned.
Next, I check my online registration system. Of course, that is were things went wrong. I got the following warning:
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; XYZ has a deprecated constructor in /aaa/bbb/ccc/xyz.php on line 35
After a lot of head scratching and internet searches I came across this post at StackOverflow. Basically, you cannot have the construct name be the same as the class name. I do a lot of Java and C# and having the constructor be the same name as the class is standard. Once I adjusted the code, the warning message went away.
Normally, I wouldn’t care about a warning message written to the logfile but PHP also put the warning message in the output stream to the remote client application which broke MQ Visual Edit’s ability to communicate with the online registration system.
Now that everything is back to normal, WordPress claims that PHP 7 is twice as fast as PHP 5 which is pretty cool.
Regards,
Roger Lacroix
Capitalware Inc.