Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:13178 php.internals:13179 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48803 invoked by uid 1010); 5 Oct 2004 18:52:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47244 invoked from network); 5 Oct 2004 18:51:53 -0000 Received: from unknown (HELO jareth.dreamhost.com) (66.33.198.201) by pb1.pair.com with SMTP; 5 Oct 2004 18:51:53 -0000 Received: from [192.168.0.152] (mail.appliedsec.com [69.17.65.231]) by jareth.dreamhost.com (Postfix) with ESMTP id 972446B609; Tue, 5 Oct 2004 11:51:52 -0700 (PDT) Message-ID: <4162ED47.2060705@velum.net> Date: Tue, 05 Oct 2004 14:51:51 -0400 User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Wez Furlong Cc: Christian Schneider , Marcus Bointon , PHP internals References: <4e89b426041004051225c86945@mail.gmail.com> <4161435C.8010108@cschneid.com> <4e89b426041004060966b3bdbe@mail.gmail.com> In-Reply-To: <4e89b426041004060966b3bdbe@mail.gmail.com> X-Enigmail-Version: 0.84.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Static call detection From: hans@velum.net (Hans L) Wez Furlong wrote: > It is *not* ok to have a static method try and work like a non static method. > In PHP 5, declaring a static method will prevent $this from being initialized. > static means static. Take this as a hint that what you're trying to > do it wrong :-) As others have mentioned on the list (and I know I've brought this up before too), it would be *extremely* useful to be able to do this. i.e. use the method statically for generic cases and allow instance objects to use a more specialized behavior. Why is it "wrong"? It feels intuitive to me, and seems like the kind of feature that would make people choose an interpreted language like PHP as opposed to Java, C#, etc. It'd be really cool, and [without thinking about it too much] I don't see the problem it creates. Certainly there's lots of PHP4 code that did that in a pretty hack, half-working way: if(isset($this)) {...}. Cheers, Hans