Re: Inconsistencies when accessing protected members

From: Date: Wed, 26 Mar 2008 17:18:59 +0000
Subject: Re: Inconsistencies when accessing protected members
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-36553@lists.php.net to get a copy of this message
Hello Alexey, Wednesday, March 26, 2008, 6:05:12 PM, you wrote: > On 3/26/08, Richard Quadling <rquadling@googlemail.com> wrote: >> It just doesn't seem right to be able to call a private or protected >> method of another instance. Sort of isn't private any more. >> And as for being able to call a protected method of a completely >> different class, just because it shares the same ancestry. That seems >> REALLY wrong. > it is needed for operations on several instances of the same class-hierarchy. > "private" means, that you are the author of the class and you know > what you are doing with instances of this class, but you do not want > to export that inner-functionality. > use case for "protected" is similiar, but relates to cases when you > have hierarchy of classes, which still have some common functionality, > which might be usable for multi-instance operations Thanks. This is the exact way we see this. Anything that violates this rule is a bug. Best regards, Marcus

« previous php.internals (#36553) next »