2

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 ヘルパーのインポート。

このエラーの内容と修正方法を誰か教えてもらえますか?

ありがとう

4

2 に答える 2

8

すでにこれを理解しているかもしれませんが、エラー報告のレベルを変更するのではなく、実際にエラーを修正したい場合は、次を変更する必要があります。

// 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;
}

問題は、 notJim の回答 hereで概説されているように、childClass::method() が parentClass::method() とは異なる引数を持っていることです。お役に立てば幸いです。

于 2013-11-19T16:21:34.227 に答える