- var_dump: documentation ( source)
- simplexml_load_string: documentation ( source)
- libxml_get_errors: documentation ( source)
- libxml_use_internal_errors: documentation ( source)
<?php
$xml = <<<XML
<?xml version="1.0"?>
<config>
<a>test</a>
</other>
XML;
libxml_use_internal_errors(true);
echo 'LOAD INVALID XML STRING' . PHP_EOL;
$simpleXML = simplexml_load_string($xml);
echo 'DETECTED ERROR:' . PHP_EOL;
var_dump(libxml_get_errors());