Re: Re: Preventing static method calls in PHP4
| From: | Marcus Bointon | Date: | Thu, 22 Jul 2004 10:26:44 +0000 |
| Subject: | Re: Re: Preventing static method calls in PHP4 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191505@lists.php.net to get a copy of this message | ||
on 22/7/04 10:49, Jason Barnett at jasbarne@indiana.edu wrote:
> The easiest way I can think of to prevent static method calls is to use the
> $this pseudo variable in your method. A method *cannot* be used statically if
> the method requires use of $this.
Unfortunately that doesn't work - it is exactly the case that fails in my
example. $this IS set in a static method that's called from any object
instance (even one of a different class), and it's a PHP feature, not a bug.
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk