在 PHP 的未来版本中,与它们的类同名的将不会是构造函数 [英] In the same name as their class will not be constructors in a future version of PHP

查看:24
本文介绍了在 PHP 的未来版本中,与它们的类同名的将不会是构造函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 wordpress,在安装插件(Visual Composer 的无限插件)后,我收到了这些错误:

I'm using wordpress and after installing a plugin (Unlimited Addons for Visual Composer), I get those error :

在未来版本的 PHP 中,不会有与它们的类同名的构造函数;WPAlchemy_MetaBox 在第 61 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vafpress/includes/wpalchemy/MetaBox.php 中有一个已弃用的构造函数不推荐使用:与它们的类同名的方法在 PHP 的未来版本中将不再是构造函数;WPAlchemy_Taxonomy 在第 17 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/taxonomy.php 中有一个已弃用的构造函数不推荐使用:与它们的类同名的方法在 PHP 的未来版本中将不再是构造函数;WPAlchemy_MetaBox1 在第 62 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/MetaBox.php 中有一个已弃用的构造函数

此外,我无法删除任何插件:

Also, I cannot delete any plugin :

抑制抑制:已弃用:在未来版本的 PHP 中,与其类同名的方法将不再是构造函数;WPAlchemy_MetaBox 在/home/hhpariskky/www/wp-content/themes/vertical/includes/vafpress/includes/wpalchemy/MetaBox.php 中的第 61 行有一个已弃用的构造函数已弃用:与它们的类同名的方法将不是构造函数PHP 的未来版本;WPAlchemy_Taxonomy 在第 17 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/taxonomy.php 中有一个已弃用的构造函数 弃用:与它们的类同名的方法将来不会成为构造函数PHP版本;WPAlchemy_MetaBox1 在/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/MetaBox.php 的第 62 行 {"success":true,"data":{"delete":" 中有一个已弃用的构造函数plugin","slug":"hello-dolly","plugin":"hello.php","pluginName":"Hello Dolly"}}

你能帮忙吗?

推荐答案

PHP 7 已弃用 带有旧的 PHP 4 样式构造函数的类:

PHP 7 deprecated classes with old, PHP 4 style constructors:

class foo {
    function foo() {
        echo 'I am the constructor';
    }
}

现在应该是:

class foo {
    function __construct() {
        echo 'I am the constructor';
    }
}

您使用的插件可能有更新版本.如果它不再获得更新,则可能需要您进行调整.

The plugin you're using may have an updated version. If it's no longer getting updates, it may be up to you to adjust it.

这篇关于在 PHP 的未来版本中,与它们的类同名的将不会是构造函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆