public static function useInternalErrors(callable $callable)
    {
        $previousErrorReporting = error_reporting();
        error_reporting(0);
        $previousLibXmlUseInternalErrors = libxml_use_internal_errors(true);
        if ($previousLibXmlUseInternalErrors) {
            libxml_clear_errors();
        }
        $return = $callable();
        try {
            static::throwFromLibXml();
        } finally {
            error_reporting($previousErrorReporting);
            libxml_use_internal_errors($previousLibXmlUseInternalErrors);
        }
        return $return;
    }
public static function useInternalErrors(callable $callable)
    {
        $previousErrorReporting = error_reporting();
        error_reporting(0);
        $previousLibXmlUseInternalErrors = libxml_use_internal_errors(true);
        if ($previousLibXmlUseInternalErrors) {
            libxml_clear_errors();
        }
        $return = $callable();
        try {
            static::throwFromLibXml();
        } finally {
            error_reporting($previousErrorReporting);
            libxml_use_internal_errors($previousLibXmlUseInternalErrors);
        }
        return $return;
    }
public static function useInternalErrors ( callable $ callable ) { $ previousErrorReporting = error_reporting ( ) ; error_reporting ( 0 ) ; $ previousLibXmlUseInternalErrors = libxml_use_internal_errors ( true ) ; if ( $ previousLibXmlUseInternalErrors ) { libxml_clear_errors ( ) ; } $ return = $ callable ( ) ; try { static :: throwFromLibXml ( ) ; } finally { error_reporting ( $ previousErrorReporting ) ; libxml_use_internal_errors ( $ previousLibXmlUseInternalErrors ) ; } return $ return ; }
Execute a callable ensuring that the execution will occur inside an environment
where libxml use internal errors is true.

After executing the callable the value of libxml use internal errors is set to
previous value.

@param callable $callable
@return mixed

@throws LibXmlException if some error inside libxml was found
Execute a callable ensuring that the execution will occur inside an environment where libxml use internal errors is true .