note 57284 rejected from function.dom-domdocument-loadxml by betz
| From: | betz@php.net | Date: | Thu, 29 Sep 2005 14:04:08 +0000 |
| Subject: | note 57284 rejected from function.dom-domdocument-loadxml by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-95975@lists.php.net to get a copy of this message | ||
Note Submitter: davidc at php dot net
----
Notice that there is a documentation bug there:
<?php
error_reporting(E_STRICT);
$doc = DOMDocument::loadXML("<root>me?</root>");
print $doc->saveXML();
?>
Will return the following:
<b>Strict Standards</b>: Non-static method DOMDocument::loadXML() should not be called
statically in <b>PHPDocument6</b> on line <b>3</b><br />
But if you are using E_ALL, you don't get any notice.
Although, you could use
<?php
$doc = new DOMDocument()->loadXML("<root>me?</root>");
?>
and avoid all the problems ;-)
My Two Cents.