Question

I have the follow error which shows in a PHP script.

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

The line in question is require_once ('./plivo.php');; an import of the plivo.com PHP helper.

Can anyone tell me what this error is and how I might fix it?

Thanks

Was it helpful?

Solution

You may have already figured this out, but in case you actually want to fix the error instead of changing the level of error reporting you need to change the following:

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

The issue is the childClass::method() has different arguments to the parentClass::method() as outlined in notJim's answer here. Hope that's helpful.

OTHER TIPS

I was using error_reporting(E_ALL); and it caused me the same issue. I removed it and now I am using error_reporting(E_ERROR); The error occurs due to E_STRICT. more info for error_reporting at : http://php.net/manual/en/function.error-reporting.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top