I have php code that doesn't work anymore
$doc = DOMDocument::loadXML($string);
$doc->formatOutput = true;
echo $doc->saveXML();
I've got error
Fatal error: Call to undefined method stdClass::saveXML() in /path/to/the/File on line 242
I've got PHP version 5.2.14
See the manual on DOMDocument:
If called statically, returns a
DOMDocument
orFALSE
on failure.
and
If an empty string is passed as the source, a warning will be generated. This warning is not generated by libxml and cannot be handled using libxml's error handling functions.
$string
is most likely empty.