Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in libxml_get_last_error #438

Open
temp opened this issue Feb 19, 2024 · 0 comments
Open

Error in libxml_get_last_error #438

temp opened this issue Feb 19, 2024 · 0 comments

Comments

@temp
Copy link

temp commented Feb 19, 2024

/**
 * 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant