Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63465 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59456 invoked from network); 16 Oct 2012 12:44:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2012 12:44:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.113 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.113 smtp113.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.113] ([207.97.245.113:52974] helo=smtp113.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/E0-10021-3B65D705 for ; Tue, 16 Oct 2012 08:44:35 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp41.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id D92F5290555; Tue, 16 Oct 2012 08:44:32 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp41.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 10DDF2904A3; Tue, 16 Oct 2012 08:44:31 -0400 (EDT) Message-ID: <507D56AE.8020101@sugarcrm.com> Date: Tue, 16 Oct 2012 15:44:30 +0300 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Clint Priest CC: "internals@lists.php.net" References: <9570D903A3BECE4092E924C2985CE485612B6466@MBX202.domain.local> <507D2AB5.1000903@sugarcrm.com> <9570D903A3BECE4092E924C2985CE485612B6C88@MBX202.domain.local> <507D3F8A.5040402@sugarcrm.com> <9570D903A3BECE4092E924C2985CE485612B6DF5@MBX202.domain.local> In-Reply-To: <9570D903A3BECE4092E924C2985CE485612B6DF5@MBX202.domain.local> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 : Interfaces From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > If you have a public property $a which internally can only deal with > it being set to 2 or 3 and someone external to the class sets it to > 4, your class either has to check that it's 2 or 3 and deal with the > fact that it is now 4 or have indeterminate results when it is set to > 4. Most of the properties, however, aren't of that nature. > The use case is that you are declaring that interface a must allow a > property $xyz to be readable and *not* writable. Why would you require for the implementor to *not* be able to do something? Interfaces were never used to make class *not* be able to do something. Are you sure it's good thing to introduce this? I think it's not. I think interfaces should only define "X should work" but not "Y should not work". > Class b does not satisfy the requirement because you are missing the > fact that public $xyz { get; } forbids setting of $xyz, only reading > it. See above, I think it's not the right use of interfaces. Also, error message produced has nothing in common with this logic. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227