- ini_set: documentation ( source)
<?php
ini_set('display_errors', 1);
$d = new DOMDocument();
$html = "<!DOCTYPE html><html><head><meta charset='UTF-8'><title>a title with a </title></head><body>U+0000 <span>before \x0 after</span><span>test</span></body></html>";
$d->loadHTML($html);
print($d->saveHTML());