Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30153 invoked from network); 13 Oct 2012 04:48:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2012 04:48:46 -0000 Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 74.115.204.51 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 74.115.204.51 relay-hub201.domainlocalhost.com Received: from [74.115.204.51] ([74.115.204.51:16640] helo=relay-hub201.domainlocalhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/36-06472-DA2F8705 for ; Sat, 13 Oct 2012 00:48:46 -0400 Received: from MBX202.domain.local ([169.254.169.44]) by HUB201.domain.local ([192.168.68.45]) with mapi id 14.02.0283.003; Sat, 13 Oct 2012 00:47:56 -0400 To: Nikita Popov CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 Thread-Index: Ac2oOZ3+vAOzWRcnRpOb6a/hOVK5+AATwXAAAB0xg5A= Date: Sat, 13 Oct 2012 04:47:55 +0000 Message-ID: <9570D903A3BECE4092E924C2985CE485612B5753@MBX202.domain.local> References: <9570D903A3BECE4092E924C2985CE485612B53E4@MBX202.domain.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.64.25] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 From: cpriest@zerocue.com (Clint Priest) The problem with that Nikita is that it would need a variable storage locat= ion, which would mean a hidden, auto-implemented property. You were dead-s= et against that from the get go. Keep in mind that property accessors are = not properties, real properties will take over the accessor, this could onl= y be done from within the setter of an accessor, but there isn't any way to= create an accessor named $Hours which accesses a variable named $Hours. In any case, your example below could be implemented without automatic crea= tion simply by doing the backing yourself, such as: private $myFoo; public $foo { get() { return $this->myFoo; } protected set($x) { $this->myFoo =3D $x; } } Again, without another "variable store" automatic properties goes out the d= oor, can't really have one without the other. Shall I hold off on this discussion point before proceeding? > -----Original Message----- > From: Nikita Popov [mailto:nikita.ppv@gmail.com] > Sent: Friday, October 12, 2012 5:48 AM > To: Clint Priest > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 >=20 > On Fri, Oct 12, 2012 at 7:23 AM, Clint Priest wrote= : > > Alright, here is the updated RFC as per discussions for the last few da= ys: > > > > https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented > > > > If you could read it over, make sure I have all of your concerns correc= tly addressed and we can leave this open for the two week > waiting period while I make the final code changes. > > > > -Clint >=20 > I've been thinking a bit about the automatic properties again, and notice= d that I forgot to name one use case: Asymmetric accessor > visibility. Automatic properties may be useful in that context, so that y= ou can write "public $foo { get; protected set; }" (though they > don't necessarily need to be implemented as properties with auto generate= d code, rather just properties with more detailed visibility > handling [a bit related to the stuff Amaury has been saying]). >=20 > Nikita