Deprecated: Methods with the same name as their class will not be constructors in a future version

在馬vBulletin遷移至PHP7中遇到php

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Datastore has a deprecated constructor in /var/www/htdocs/vbbbs/includes/class_core.php on line 1128it

經查PHP7 再也不支持與類名相同的構造方法,構造方法統一使用 __construct(), 好比下面的寫法 PHP7 就會報這個錯誤。io

也就是若是在代碼中ast

class vB_Databasefunction

...class

...方法

function vB_Databasetab

將不被建議,因此,須要將第二個vB_Database改成co

function __contruct()constructor

便可。

相關文章
相關標籤/搜索