Re: svn: /phpdoc/en/trunk/language/oop5/ visibility.xml
| From: | Richard Quadling | Date: | Fri, 11 Jun 2010 09:45:58 +0000 |
| Subject: | Re: svn: /phpdoc/en/trunk/language/oop5/ visibility.xml | ||
| References: | 1 2 3 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-6809@lists.php.net to get a copy of this message | ||
On 11 June 2010 10:40, Daniel Egeberg <degeberg@php.net> wrote:
> On Fri, Jun 11, 2010 at 11:16, Richard Quadling <rquadling@gmail.com> wrote:
>> On 11 June 2010 09:55, Daniel Egeberg <degeberg@php.net> wrote:
>>> degeberg Fri, 11 Jun 2010 08:55:34
>>> +0000
>>>
>>> Revision:
>>> http://svn.php.net/viewvc?view=revision&revision=300372
>>>
>>> Log:
>>> Explained that it is possible accessing private and protected members of other
>>> instances of the same object type.
>>>
>>> Changed paths:
>>> U phpdoc/en/trunk/language/oop5/visibility.xml
>>>
>>> *snip*
>>>
>>> --
>>> PHP Documentation Commits Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> That "smells" like a bug. Private not being private. Sort of isn't
>> private anymore. I know that everyone in the company has a bank
>> account, but I can't get to it just because I know how to read my own.
>
> It is not a bug. Marking members as private or protected is to
> encapsulate things and hide implementation details. When you are
> inside the Test class, there is nothing to hide about Test's
> implementation even though it's a different instance.
>
> You'll find similar behavior in C# [1], Java [2] and likely other
> languages as well.
>
> [1] http://pastebin.com/mtkUD2fp
> [2] http://pastebin.com/cTb9PTQq
>
> --
> Daniel Egeberg
>
Ah. OK. I see what you mean. OOI, is there any technique (in PHP or
otherwise) that allows for private properties at the instance level?
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling