Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47890 invoked by uid 1010); 14 May 2006 02:34:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47875 invoked from network); 14 May 2006 02:34:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 May 2006 02:34:11 -0000 X-PHP-List-Original-Sender: jason@ionzoft.com X-Host-Fingerprint: 66.216.66.81 mail.ionzoft.com Linux 2.4/2.6 Received: from ([66.216.66.81:33943] helo=mail.ionzoft.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B6/7D-19568-22796644 for ; Sat, 13 May 2006 22:34:10 -0400 Received: from JASONGARBER2 (207-255-4-232-static.aoo.pa.atlanticbb.net [207.255.4.232]) by mail.ionzoft.com (Postfix) with ESMTP id 846D48A4005; Sat, 13 May 2006 22:35:31 -0400 (EDT) Date: Sat, 13 May 2006 22:34:03 -0400 X-Mailer: The Bat! (v3.65.03) Professional Reply-To: Jason Garber Organization: IonZoft, Inc. X-Priority: 3 (Normal) Message-ID: <837405862.20060513223403@ionzoft.com> To: Marcus Boerger CC: internals@lists.php.net In-Reply-To: <932738738.20060513112734@marcus-boerger.de> References: <785810036.20060511193536@ionzoft.com> <44647B7A.2070301@php.net> <932738738.20060513112734@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] private, protected, readonly, public From: jason@ionzoft.com (Jason Garber) Hello Marcus, class x { public readonly $xyz; protected readonly $abc; } Definitions: - public readonly - outside class can only read, not write. - protected readonly - subclass can only read, not write. - private readonly - does not make sense - do not support. How difficult would it be to build this into the PHP engine? -- Best regards, Jason mailto:jason@ionzoft.com Saturday, May 13, 2006, 5:27:34 AM, you wrote: MB> Hello Etienne, MB> Friday, May 12, 2006, 2:11:38 PM, you wrote: >> Hi, >> my 2c: >> 1) it shouldn't replace the visibility definition: we could also have >> protected readonly properties. MB> same here visibility and read/write control are two seperate things. >> 3) how would you check if the property if readonly ? Trying it could >> result to a Fatal error as you wanted. You would then need a >> isReadonly() method/function: the function call wouldn't be spared. MB> We could add this to reflection api easily. MB> Best regards, MB> Marcus