Doc #41398 [Ver->Csd]: DOMDocument->loadXML() documents static is okay, but gives E_STRICT

From: Date: Wed, 10 Nov 2010 22:01:53 +0000
Subject: Doc #41398 [Ver->Csd]: DOMDocument->loadXML() documents static is okay, but gives E_STRICT
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5519@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=41398&edit=1 ID: 41398 Updated by: salathe@php.net Reported by: RQuadling at GMail dot com Summary: DOMDocument->loadXML() documents static is okay, but gives E_STRICT -Status: Verified +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Windows XP SP2 PHP Version: 5.3.4-dev -Assigned To: +Assigned To: salathe Block user comment: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2010-11-10 22:34:46] salathe@php.net Automatic comment from SVN on behalf of salathe Revision: http://svn.php.net/viewvc/?view=revision&revision=305261 Log: Added common E_STRICT error paragraph for ZEND_ACC_ALLOW_STRICT methods called statically. See #41398 ------------------------------------------------------------------------ [2010-09-05 05:22:58] philip@php.net Type->Doc_Problem (I was just bitten by this) ------------------------------------------------------------------------ [2007-05-16 13:13:58] rrichards@php.net This is specific to internal classes using the ZEND_ACC_ALLOW_STRICT flag (not a true static method). Technically there should be methods with different names (one static and one non-static) - hence the E_STRICT message so the user can then decide whether to break strict standards or not. This is something that most likely needs to be clarified in the docs (you can but in most cases shouldn't) ------------------------------------------------------------------------ [2007-05-16 12:08:08] RQuadling at GMail dot com I would propose that this E_STRICT warning is removed, allowing the methods to be called statically and NOT generate a warning. I understand that in userland classes, calling a non static method statically is wrong (because the original developer didn't say the method could be called statically), but in the case of the few methods in DOM/XMLReader (and untested the one in persistent COM), they HAVE been declared static, so they CAN be called statically and therefore they ARE following strict rules. It seems to me anyway. I know I've missed something here. Is it that internal classes and userland classes are treated differently internally? (I can't see that being the case as you'd have to maintain 2 different models of operation for the same thing). ------------------------------------------------------------------------ [2007-05-16 12:02:01] RQuadling at GMail dot com So, should the documentation by amended to say that whilst they CAN be called statically, they shouldn't. It is trying to define the reason why they shouldn't be called that is the problem. I'm not an internals guy, but it if DOES work, even with E_STRICT, why does it report it as a problem at all. I can appreciate a WFx on this - if it works why break it. I suppose what I'm trying to work out is why is it NOT strict OOP? Calling a static method is just what is being done and it IS working and no-one can tell why it is a problem to do so. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=41398 -- Edit this bug report at http://bugs.php.net/bug.php?id=41398&edit=1

« previous php.doc.bugs (#5519) next »