Re: What ZEND_ACC_ALLOW_STATIC is supposed to do
| From: | Rowan Collins | Date: | Tue, 16 Dec 2014 01:19:10 +0000 |
| Subject: | Re: What ZEND_ACC_ALLOW_STATIC is supposed to do | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79683@lists.php.net to get a copy of this message | ||
On 16 December 2014 00:56:43 GMT, Tjerk Meesters <tjerk.meesters@gmail.com> wrote:
>Hi,
>
>I was looking at the documentation for DOMDocument::loadHTML() [1] that
>mentions the following:
>
>> This function may also be called statically to load and create a
>DOMDocument object. The static invocation may be used when no
>DOMDocument properties need to be set prior to loading.
>
>However, this can’t be done in strict mode [2]:
>
>> Strict Standards: Non-static method DOMDocument::loadHTML() should
>not be called statically in …
>
>This behaviour seems to be intended when ZEND_ACC_ALLOW_STATIC is used
>[3] and can be fixed by using ZEND_ACC_STATIC instead.
>
>My questions:
>
>1) Is that the right kind of fix?
>2) Is ZEND_ACC_ALLOW_STATIC meant to be used only for BC? If not, why
>are we raising strict errors?
Surely that's just the same as a userland method which happens not to use $this ("allow
static") and one marked "static" so *must* be called statically?