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
433

I'm trying to upgrade the PHP version of my WP website, which is hosted on SiteGround. The upgrade tool displays the following error:

33 | WARNING | As of PHP 7, using the deprecated PHP4-style class constructors is not supported

This is the code I found at the given location:

function gc_XmlBuilder($indent = ' ') { $this->indent = $indent; $this->xml = ''."\n"; }

How do I fix this problem?

P粉713846879
P粉713846879

reply all (1)
P粉755863750
function __construct($indent = ' ') { $this->indent = $indent; $this->xml = ''."\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
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!