DomDocument::loadXml not throwing exceptions in PHP
30 September 2005, by Karl Bunyan
For some reason, Zend have decided not to make PHP throw an exception when you try and load invalid XML into a DomDocument object... which is annoying.
For some reason, Zend have decided not to make PHP throw an exception when you try and load invalid XML into a DomDocument object. This includes XML with invalid characters e.g. &. This means wrapping a try/catch around anything does absolutely no good whatsoever, which is annoying.
Is there a good way of trapping runtime errors using loadXml with the DomDocument library?
September 30, 2005 at 10:42 am
Filed in: PHP, Programming
No comments