Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52011 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24711 invoked from network); 26 Apr 2011 02:31:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2011 02:31:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain gmail.com does not designate 208.113.200.5 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 208.113.200.5 caibbdcaaaaf.dreamhost.com Windows 98 (1) Received: from [208.113.200.5] ([208.113.200.5:45716] helo=homiemail-a48.g.dreamhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/DA-40703-28E26BD4 for ; Mon, 25 Apr 2011 22:31:31 -0400 Received: from homiemail-a48.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a48.g.dreamhost.com (Postfix) with ESMTP id 2B7CA4F805B for ; Mon, 25 Apr 2011 19:31:28 -0700 (PDT) Received: from [192.168.3.3] (softbank221040106178.bbtec.net [221.40.106.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: david@thefourstooges.com) by homiemail-a48.g.dreamhost.com (Postfix) with ESMTPSA id C0DC74F8058 for ; Mon, 25 Apr 2011 19:31:27 -0700 (PDT) Message-ID: <4DB62E7D.2010508@gmail.com> Date: Tue, 26 Apr 2011 11:31:25 +0900 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: internals@lists.php.net References: <5870D50E38AE4374833F83A59ABFB59E@gmail.com> <4DB4847B.3080004@gmail.com> <20110424202353.GC21102@crousti> <4DB613C0.4060905@yahoo.com.au> In-Reply-To: <4DB613C0.4060905@yahoo.com.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't From: davidkmuir@gmail.com (David Muir) On 26/04/11 09:37, Ben Schmidt wrote: >> Back in PHP4 it was the only way to "simulate" an static call, but >> nowadays it really don't make sense at all. >> >> class Foo { >> static function toString(Bar $bar) { >> return 'Foo::toString($bar)'; >> } >> function toString() { >> return '$this->toString()'; >> } >> } >> >> $foo = new Foo(); >> echo $foo->toString(); // instance >> echo Foo::toString(); // class >> >> PHP will complain about the 2nd method (can't redefine function) but >> for me >> are 2 completely different methods. >> I belive the current Object Model could be improved. isn't? > > I agree. Backward compatibility is the only reason to keep this. It's a > pretty compelling reason, though. It's hard to know how to phase it out > "non-invasively", too. > > Ben. > > Why not just deprecate it, and throw a E_STRICT warning? That's how we're dealing with all other future BC breaks. David