Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
报错
( ! ) Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON_Error has a deprecated constructor in D:\wamp\www\kindeditor\JSON.php on line 795
解决方案
通过查看PHP官网的文档发现,php7.0之后将不再支持与类名相同的构造方法,构造方法统一使用 __construct()。
查找代码:D:\wamp\www\kindeditor\JSON.php on line 第795 行
原文件
class Services_JSON_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
}
}
改为
class Services_JSON_Error
{
function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
}
}
将 function Services_JSON_Error 改为 function __construct