Title rewritten to read: PHP 7 is no longer compatible with using deprecated PHP4-style class constructors
P粉713846879
P粉713846879 2023-08-25 00:18:16
0
1
634
<p>I'm trying to upgrade the PHP version of my WP website, which is hosted on SiteGround. The upgrade tool displays the following error: </p> <blockquote> <p>33 | WARNING | As of PHP 7, using the deprecated PHP4-style class constructors is not supported</p> </blockquote> <p>This is the code I found at the given location: </p> <pre class="brush:php;toolbar:false;">function gc_XmlBuilder($indent = ' ') { $this->indent = $indent; $this->xml = '<?xml version="1.0" encoding="utf-8"?>'."\n"; }</pre> <p>How do I fix this problem? </p>
P粉713846879
P粉713846879

reply all(1)
P粉755863750
function __construct($indent = '  ') {
  $this->indent = $indent;
  $this->xml = '<?xml version="1.0" encoding="utf-8"?>'."\n";
}

Since you used to be able to define constructors by class name, but this has been deprecated since PHP 7:

Error example, according to the documentation:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template