- var_dump: documentation ( source)
- libxml_use_internal_errors: documentation ( source)
<?php
$locator = 'and position()=1]';
libxml_use_internal_errors(true);
libxml_suppress_errors(true);
$document = new \DOMDocument('1.0', 'UTF-8');
$xpath = new \DOMXPath($document);
var_dump( $xpath->evaluate($locator, $document) );