我有一个 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's answer here 中所述。 .希望对您有所帮助。
关于php - 严格标准:响应声明::toXML() 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19344915/