Edit report at https://bugs.php.net/bug.php?id=29206&edit=1
ID: 29206 Comment by: hanskrentel at yahoo dot de Reported by: tommy at vandervorst-bs dot nl Summary: DOMDocument::LoadXML: Strict Standards: DOMDocument::loadXML(); is not static Status: Not a bug Type: Bug Package: DOM XML related Operating System: Windows Server 2003 Standard PHP Version: 5.0.0 Block user comment: N Private report: N New Comment: In PHP 5.3.10 Windows I have the problem that it's giving an error. In my eyes it does not violate strict standards as the PHP documentation for that function states that this function can be called statically as well. Could this be reviewed? Previous Comments: ------------------------------------------------------------------------ [2006-01-10 01:32:02] nfor...@php.net Surely the error message here is misleading. These functions/methods are clearly marked with ALLOW_STATIC... they definitely should not throw any sort of notice. Here's a patch to eliminate the message completely: http://noel.dotgeek.org/allow_static.patch ------------------------------------------------------------------------ [2004-07-16 12:43:39] rricha...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is not a pure static method as it is really an object method that is also allowed to be called statically, so under E_STRICT, that non-fatal message is issued. add $d->saveXML() and you will see the document was loaded. ------------------------------------------------------------------------ [2004-07-16 11:56:34] tommy at vandervorst-bs dot nl Description: ------------ The following code: $d = DOMDocument::loadXML("<some><xml><here></here></xml></some>"); works perfectly well, but when setting PHP to report E_STRICT warnings: error_reporting(E_ALL|E_STRICT); It says: Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in [some script] on line [some line] which I think is incorrect, since DOMDocument::loadXML is (even according to the manual, http://nl2.php.net/manual/en/function.dom-domdocument-loadxml.php) a static function. Reproduce code: --------------- <?php error_reporting(E_ALL|E_STRICT); $d = DOMDocument::loadXML("<some><xml><here></here></xml></some>"); ?> Expected result: ---------------- No error, this code is (in my eyes) perfectly valid. Actual result: -------------- Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in [some script] on line [some line] ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=29206&edit=1