Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63447 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26508 invoked from network); 16 Oct 2012 10:23:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2012 10:23:31 -0000 Authentication-Results: pb1.pair.com header.from=tbprogrammer@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tbprogrammer@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.42 as permitted sender) X-PHP-List-Original-Sender: tbprogrammer@gmail.com X-Host-Fingerprint: 209.85.219.42 mail-oa0-f42.google.com Received: from [209.85.219.42] ([209.85.219.42:63049] helo=mail-oa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/F9-10021-2A53D705 for ; Tue, 16 Oct 2012 06:23:31 -0400 Received: by mail-oa0-f42.google.com with SMTP id j1so6571071oag.29 for ; Tue, 16 Oct 2012 03:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VlTWgh6l0PxVgNr4Oz8jPMSfdeqDIeciV8cP7v6V2NI=; b=toS46BvtkuWjD8Y3kt41Dxu8wXQ/4eUkXIa8RV4ORLPtbU+JqUmeym682SntrGvbPM o/Qw2NrvR4MpCqZRx7WD23JlsOjGsklwcmGwl4EDnWFYMhzzMSHpoKCrLqu9lZ73s9sQ 1W/c4mVet0A++y5IrplQskeDsspx94endDlK0o9EZCsLiiyAM6gzOxX7cnICbHXou62l 4menG2errBkA5Cn5XQuRpThMQt53zd1LBdsXJIJ0TsNZBMztWw+oDfKub5RQoO36pxXQ gis06UUWqDLJHhScd09+yoNcmFC5q5sco3IaRuX7eGRc4iQYXXivErszE2CmlbG8xlO8 2dDQ== Received: by 10.60.19.37 with SMTP id b5mr12374355oee.16.1350383007993; Tue, 16 Oct 2012 03:23:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.11.170 with HTTP; Tue, 16 Oct 2012 03:22:59 -0700 (PDT) In-Reply-To: <507D3459.3020900@sugarcrm.com> References: <9570D903A3BECE4092E924C2985CE485612B53E4@MBX202.domain.local> <507D24E0.9070203@sugarcrm.com> <507D2C54.6030702@sugarcrm.com> <507D3459.3020900@sugarcrm.com> Date: Tue, 16 Oct 2012 03:22:59 -0700 Message-ID: To: Stas Malyshev Cc: Clint Priest , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8ff1c4b88090fd04cc2a8b19 Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 From: tbprogrammer@gmail.com (Jazzer Dane) --e89a8ff1c4b88090fd04cc2a8b19 Content-Type: text/plain; charset=ISO-8859-1 Stas, the proposed "solution" thus far is to make the getter or setter final and private and not have a body. This would naturally throw an exception if it was accessed from anywhere but the class it was defined. The class it was defined in has to remember that it is virtually a read/write only accessor. Although it has not been proposed yet, perhaps the above can be further enforced by automatically throwing an exception whenever a getter/setter exists but does not have a body. Nevertheless, the "solution" is, as you can see, pretty loose right now, and I definitely wouldn't object to hearing and discussing alternative proposals. On Tue, Oct 16, 2012 at 3:18 AM, Stas Malyshev wrote: > Hi! > > > In regards to #11, yes, you'd just write {}. I imagine you could also > > This doesn't work for the same class (and for traits which put things in > the context of the same class) - it would not behave as "no setter", it > would behave as "there's a setter doing nothing". Is this the proposed > solution? > > Exception is a possibility but then everybody would do it differently > which reduces the value of standardizing it (the whole point of having > accessors since otherwise we could just do __get and throw exceptions). > > > We went through multiple alternative options to read/write-only, and the > > implementation you see in the 1.2 RFC is the most widely agreed upon > > proposal. I don't doubt that there is room for improvement in this area, > > but we haven't had any further proposals as of yet. > > Actually, I do not see anything explicitly said in the proposal that > works for the cases outlined above. I wanted to just make sure if that > means "no solution currently" (then should be on TODO list) or "we have > a solution but it's not outlined in the RFC" (should be added then). > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > --e89a8ff1c4b88090fd04cc2a8b19--