把php版本从5.6切换到7.2上,报如下错误:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP;
这个报错的原因是 PHP7 不再支持与类名相同的构造方法,构造方法统一使用 __construct(), 比如下面的写法 PHP7 就会报这个错误
改前为:
改之后为:
把php版本从5.6切换到7.2上,报如下错误:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP;
这个报错的原因是 PHP7 不再支持与类名相同的构造方法,构造方法统一使用 __construct(), 比如下面的写法 PHP7 就会报这个错误
改前为:
改之后为: