严格的标准:声明响应::toXML() 错误


Strict Standards: Declaration of Response::toXML() error

我有以下错误,该错误显示在PHP脚本中。

Strict Standards: Declaration of Response::toXML() should 
be compatible with Element::toXML($header = false) in line 35

有问题的行是require_once ('./plivo.php');;plivo.com PHP助手的导入。

谁能告诉我这个错误是什么以及如何解决它?

谢谢

您可能已经弄清楚了这一点,但是如果您实际上想要修复错误而不是更改错误报告级别,则需要更改以下内容:

// In the plivo.php helper file we're looking at
// the Response class that extends the Element class
// Change the following function from:
public function toXML() {
    $xml = parent::toXML($header=TRUE);
    return $xml;
}
// To:
public function toXML($header=TRUE) {
    $xml = parent::toXML($header);
    return $xml;
}
问题是childClass::method()

与parentClass::method()具有不同的参数,如notJim的答案中所述。希望对您有所帮助。

我正在使用error_reporting(E_ALL);,它引起了我同样的问题。我删除了它,现在我正在使用error_reporting(E_ERROR);由于E_STRICT而发生错误。有关error_reporting的更多信息,请访问:http://php.net/manual/en/function.error-reporting.php