Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56434 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97390 invoked from network); 19 Nov 2011 19:45:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2011 19:45:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain strojny.net from 46.4.40.248 cause and error) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 46.4.40.248 milch.schokokeks.org Received: from [46.4.40.248] ([46.4.40.248:43054] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/3E-17432-C6708CE4 for ; Sat, 19 Nov 2011 14:45:50 -0500 Received: from [192.168.178.32] (ppp-188-174-42-169.dynamic.mnet-online.de [::ffff:188.174.42.169]) (AUTH: PLAIN lars@schokokeks.org, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by milch.schokokeks.org with ESMTPSA; Sat, 19 Nov 2011 20:45:44 +0100 id 0000000000000022.000000004EC80769.000071DA Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=windows-1252 In-Reply-To: <9570D903A3BECE4092E924C2985CE48539811627@MBX206.domain.local> Date: Sat, 19 Nov 2011 20:45:43 +0100 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <79A6C298-1475-4B69-A47D-27D3DEA4BC0E@strojny.net> References: <9570D903A3BECE4092E924C2985CE48539811627@MBX206.domain.local> To: Clint M Priest X-Mailer: Apple Mail (2.1251.1) Subject: Re: [PHP-DEV] Multiple Visibility Level Getters/Setters From: lars@strojny.net (Lars Strojny) Just throw an error if conflicting accessors are defined. In the case of = subtypes: accessors may broaden the interface, but not limit it =3D> = LSP. So it=92s fine to make a parents protected accessor public, but not = the other way around. Am 19.11.2011 um 02:46 schrieb Clint M Priest: > What would everyone think about multiple levels of visibility for = getters/setters? >=20 > class Sample { >=20 > public $Variable { > public get { return "Public"; } > protected get { return "Protected"; } > private get { return "Private"; } >=20 > public set { ... } > private set { ... } > } > } >=20 > Whichever getter/setter would be called with the most restricted = access, so externally public, internally protected (if inherited) or = private from within. >=20 > Any value to this? I can see some use cases and wouldn't be any more = difficult to implement into what I'm already doing. >=20 > -Clint