Re: private, protected, readonly, public

From: Date: Sun, 14 May 2006 02:34:03 +0000
Subject: Re: private, protected, readonly, public
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-23339@lists.php.net to get a copy of this message
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

« previous php.internals (#23339) next »