Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52012 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29331 invoked from network); 26 Apr 2011 03:31:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2011 03:31:15 -0000 Authentication-Results: pb1.pair.com header.from=reeze.xia@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=reeze.xia@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: reeze.xia@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pw0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:61381] helo=mail-pw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/6B-40703-28C36BD4 for ; Mon, 25 Apr 2011 23:31:14 -0400 Received: by pwj3 with SMTP id 3so218119pwj.29 for ; Mon, 25 Apr 2011 20:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:message-id:in-reply-to :references:subject:x-mailer:mime-version:content-type :content-transfer-encoding; bh=zFhMQWydJ3nWMlyxF8W4FI69VGGbRJSe1Ne3LcCCZFg=; b=WZDws4LkSIEf2EOujAu31Ifgit6IxcRP3+7/s8CK7coa7pPSazDCMZS490z2q4gvnG LDQ+pXLM8kMefjUUqfMn7QLxpBcKE/DghKgdRl30pvNGtaU3EWYNs7ZwlhUPyTSvf5Oc kJbWwjzWj4I7hDBYsw2JexeJa3lls8GwDtrLs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding; b=j1X83mu0bJcl53loCE0nEP0IRQG7EOse2MeOyWO4jCaLPkDl9qQqeXipYc0c/de9qx Y3jvqqnlkgPGPChTqEgIoNFYlskKKsxqnhxJolTrz/vvXOcrFUTXyuTvBXDZzz8VYS/j St9/wRStCerCtDdbuhX3EXjvb+Yf5iWrM8fUw= Received: by 10.68.51.196 with SMTP id m4mr361425pbo.465.1303788669854; Mon, 25 Apr 2011 20:31:09 -0700 (PDT) Received: from Snow.local ([61.135.165.180]) by mx.google.com with ESMTPS id i7sm4270483pbs.19.2011.04.25.20.31.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2011 20:31:08 -0700 (PDT) Date: Tue, 26 Apr 2011 11:30:57 +0800 To: David Muir Cc: internals@lists.php.net Message-ID: <26521B79ADC84D1F85EC8F6BA5F5B0EC@gmail.com> In-Reply-To: <4DB62E7D.2010508@gmail.com> References: <5870D50E38AE4374833F83A59ABFB59E@gmail.com> <4DB4847B.3080004@gmail.com> <20110424202353.GC21102@crousti> <4DB613C0.4060905@yahoo.com.au> <4DB62E7D.2010508@gmail.com> X-Mailer: sparrow 1.0.1 (build 589.15) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="4db63c71_519b500d_fb" Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't From: reeze.xia@gmail.com (reeze) --4db63c71_519b500d_fb Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On 2011年4月26日星期二 at 上午10:31, David Muir wrote: 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. +1 just like call non-static method statically did > > > David > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --4db63c71_519b500d_fb--