libxml_set_streams_context> <libxml_get_errors
Last updated: Fri, 24 Feb 2012

libxml_get_last_error

(PHP 5 >= 5.1.0)

libxml_get_last_error Retorna o último erro da libxml

Descrição

LibXMLError libxml_get_last_error ( void )

Retorna o último erro da libxml.

Valor Retornado

Retorna um objeto LibXMLError se há algum erro no buffer, FALSE caso contrário.

Veja Também



User Contributed Notes
libxml_get_last_error
Sergey M
24-Aug-2007 11:27
this function returns a LibXMLError object to see whats in it, use var_dump()
Paul Annesley
22-Aug-2007 09:57
Note that the libxml error buffer can persist between HTTP requests.  This seems to affect libxml_get_last_error() but not libxml_get_errors().  The former can return an error object while the latter is an empty array.

lib_xml_get_last_error() will happily return errors from a previous HTTP request, even if lib_xml_get_errors() is empty.  This includes errors handled by PHP due to libxml_use_internal_errors() being set to false.

If you using libxml_use_internal_errors() to expect and handle an XML error, you should always call libxml_clear_errors() as well.

Tested against mod_php 5.2.3 (DSO) under Apache 2.0.52 (Linux).

libxml_set_streams_context> <libxml_get_errors
Last updated: Fri, 24 Feb 2012