/**
* Retrieve last error from libxml.
*
* @return \LibXMLError Returns a LibXMLError object if there is any error in the
* buffer, FALSE otherwise.
* @throws LibxmlException
*
*/
function libxml_get_last_error(): \LibXMLError
{
error_clear_last();
$safeResult = \libxml_get_last_error();
if ($safeResult === false) {
throw LibxmlException::createFromPhpError();
}
return $safeResult;
}
I guess something got mixed up here. libxml_get_last_error() returns false if no error occurred, but in the safe function this will trigger an Exception.
I guess something got mixed up here.
libxml_get_last_error()
returns false if no error occurred, but in the safe function this will trigger an Exception.