I have been experiencing some bad returns on xml that I get from another server. I'd like to add some reporting on this for myself but I need to find a sure fire way to identify when simple xml fails.
The errors happen on this specific point $xmlResponse = new SimpleXMLElement( $response );
so basically if there is SimpleXMLElement->__construct
error trigger i want to detect this and fire my reporting.
E.g.
if($xmlResponse === Fail){
// Do reporting
}
any ideas appreciated. I also cant rely on http responses as the response code could be fine but there might be issues with the xml itself.