I am trying to upgrade the PHP version of my WP site which is hosted on SiteGround. Upgrader tool shows this error:
33 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7
This is the code I found at the given location:
function gc_XmlBuilder($indent = ' ') {
$this->indent = $indent;
$this->xml = '<?xml version="1.0" encoding="utf-8"?>'."\n";
}
How do I fix that?
Change the function to:
As you used to be able to define constructors via the class name and that has been deprecated as of PHP 7:
The error example, as per the documentation: