- libxml_get_errors: documentation ( source)
- print_r: documentation ( source)
- libxml_use_internal_errors: documentation ( source)
<?php
$xml = <<<XML
<?xml version="1.0"?>
<rootElem>
XML;
libxml_use_internal_errors(true);
$reader = new XMLReader();
$reader->xml($xml);
$reader->read();
print_r(libxml_get_errors());