- error_reporting: documentation ( source)
<?php
error_reporting(E_ALL | E_STRICT);
class MyDOM extends DOMDocument {
/**
* @param \DOMNode|\DOMNodeList|NULL $context
* @param int $options
* @return string
*/
public function saveXML($context = NULL, $options = 0) {
if ($context instanceof DOMNodeList) {
$result = '';
foreach ($context as $node) {
$result .= parent::saveXML($node, $options);
}
return $result;
}
return parent::saveXML($context, $options);
}
}
$dom = new MyDOM();