Hi!

> just stumbled upon a strange issue.
> I always thought that protected/private member variables can only be
> altered from inside the object.

No, it's not correct. Private members are visible withing this class'
scope, protected members are visible within this class' hierarchy.

The reason is that private is considered a detail of implementation of
particular class (thus visible to this class only), and protected is a
member of this class internal API (i.e. visible to extending classes but
not to external users of the class).
-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to