#29206 [Bgs]: DOMDocument::LoadXML: Strict Standards: DOMDocument::loadXML(); is not static

From: Date: Tue, 10 Jan 2006 00:32:04 +0000
Subject: #29206 [Bgs]: DOMDocument::LoadXML: Strict Standards: DOMDocument::loadXML(); is not static
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91704@lists.php.net to get a copy of this message
ID: 29206 Updated by: nforbes@php.net Reported By: tommy at vandervorst-bs dot nl Status: Bogus Bug Type: DOM XML related Operating System: Windows Server 2003 Standard PHP Version: 5.0.0 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2004-07-16 12:43:39] rrichards@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 http://bugs.php.net/?id=29206&edit=1

« previous php.bugs (#91704) next »