Re: getThis and static methods
| From: | Antony Dovgal | Date: | Thu, 31 Jan 2008 08:53:17 +0000 |
| Subject: | Re: getThis and static methods | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-5093@lists.php.net to get a copy of this message | ||
http://news.php.net/php.internals/35031
http://news.php.net/php.internals/35032
?
On 31.01.2008 10:51, Piotr Pokora wrote:
> Hi!
>
> If a static function is invoked, should I explicitly check object's class and its derived
> ones.
> Is there any API functionality which tells me that static call is made? I mean ZE2.
>
> Let's say function foo is implemented in extension and does something with object's
> pointer, if this one is available with getThis(). Now on PHP level I use it in another
> class'
> member:
>
> class bar extends foo
> {
> some_method()
> {
> foo::abc(); /* _may_ be called statically */
> }
> }
>
> foo::abc gets $this pointer via getThis(), which is not correct, as $this pointer should be
> only foo class' instance in this scope. Am I right or completely wrong here?
>
> Piotras
>
--
Wbr,
Antony Dovgal