Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63445 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22457 invoked from network); 16 Oct 2012 10:03:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2012 10:03:06 -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.214.170 as permitted sender) X-PHP-List-Original-Sender: tbprogrammer@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:54948] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/19-10021-9D03D705 for ; Tue, 16 Oct 2012 06:03:05 -0400 Received: by mail-ob0-f170.google.com with SMTP id ni5so6488540obc.29 for ; Tue, 16 Oct 2012 03:03:01 -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=HtxLTvr3ytEb878JtdH9LOUq3H9pM8D8y7Fz0IKsQtg=; b=a7dZR/80LQhJplJ+87mWtp2qzWQ+/O4WZMAXybgprs1LSxZtmW7ozGSKTOEzW1JSPz xxnnYIWYfJoCjtK+bNELPCfqQmgoL18HIXEBIWwQw308IikxV48k/JHJSo8zmpP7m77J SGoJvj9GagNsoFmvNZUrv8WdPNkhDJgVe0THFXRv1Ye/mgrhHnQFpk/3nDLB/BqN09D4 qnNZU8HRjRcysp8EQMXOg2x2haRRHt1VBHv5L5+RYT5cyuN/ttsK9D2EpkMbgYUOQrek gSbhXgV6xOY+sOGC1W6FJB4zO9mm21sKWqKOwfEivQ72jAr4kin65pQ1HgaG8x/LN5ar EsIg== Received: by 10.60.29.230 with SMTP id n6mr12247625oeh.123.1350381781852; Tue, 16 Oct 2012 03:03:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.11.170 with HTTP; Tue, 16 Oct 2012 03:02:41 -0700 (PDT) In-Reply-To: <507D2C54.6030702@sugarcrm.com> References: <9570D903A3BECE4092E924C2985CE485612B53E4@MBX202.domain.local> <507D24E0.9070203@sugarcrm.com> <507D2C54.6030702@sugarcrm.com> Date: Tue, 16 Oct 2012 03:02:41 -0700 Message-ID: To: Stas Malyshev Cc: Clint Priest , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8ff1c1466b21f004cc2a42d6 Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 From: tbprogrammer@gmail.com (Jazzer Dane) --e89a8ff1c1466b21f004cc2a42d6 Content-Type: text/plain; charset=ISO-8859-1 In regards to #11, yes, you'd just write {}. I imagine you could also just throw an exception. Maybe an exception could be thrown automatically if there is no code between the braces. Though this doesn't really directly relate to providing the ability to disable get/set in an accessor. The only class that would ever be able to logically attempt to use the empty getter/setter would be the very one that you define the accessor in. 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. On Tue, Oct 16, 2012 at 2:43 AM, Stas Malyshev wrote: > Hi! > > > #5: From what I understand, an extending class can not override an > > accessor with a non-accessor. > > This should be in the RFC then - along with what exactly happens. Note > that this will represent a sort of BC break in terms that you could have > two properties $a before, but if you change implementation of $a in base > class from plain old property to accessor property, the child class > would break. Which is not good, since compatible changes in parent class > should not break child classes - and which will also impede adoption of > this feature, since you can not guarantee no child class does it. > > > #11: If you set an accessor's get or set to /final private/, you are not > > able to extend and it are only able to invoke it from the current class. > > If you don't invoke it, then it is virtually read or write only. > > I get this, but what do you write as a method body if you want to just > disallow it? Do you write just {}? Then it's not good for get() since > get() is supposed to return a value, and also not good for set() since > base class still can call private methods, and we want set() to be not > available for everybody. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > --e89a8ff1c1466b21f004cc2a42d6--