我使用PHP7收到上述错误。任何人都可以告诉我,如何解决它?
class rexUrlRewriter
{
function __construct()
{
// do nothing
}
}
class myUrlRewriter extends rexUrlRewriter
{
function __construct($use_levenshtein = false, $use_params_rewrite = false)
{
parent::rexUrlRewriter();
}
答案 0 :(得分:0)
parent :: rexUrlRewriter();
未捕获错误:调用未定义的方法rexUrlRewriter :: rexUrlRewriter()
通过此parent::rexUrlRewriter();
,您实际上是在尝试调用类rexUrlRewriter
的静态方法rexUrlRewriter
,以便调用父类构造函数使用parent::__construct(...);
将其更改为:
class myUrlRewriter extends rexUrlRewriter
{
function __construct($use_levenshtein = false, $use_params_rewrite = false)
{
parent::rexUrlRewriter();
}
的此:强>
class myUrlRewriter extends rexUrlRewriter
{
function __construct($use_levenshtein = false, $use_params_rewrite = false)
{
parent::_construct();//Added this line to call parent class constructor
}
}