this function returns a LibXMLError object to see whats in it, use var_dump()
libxml_get_last_error
(PHP 5 >= 5.1.0)
libxml_get_last_error — 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
- libxml_get_errors() - Retorna um array de erros
- libxml_clear_errors() - Limpa o buffer de erro da libxml
User Contributed Notes
libxml_get_last_error
libxml_get_last_error
Sergey M
24-Aug-2007 11:27
24-Aug-2007 11:27
Paul Annesley
22-Aug-2007 09:57
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_get_errors