Re: Access of protected members

From: Date: Mon, 03 Aug 2015 19:43:37 +0000
Subject: Re: Access of protected members
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-87584@lists.php.net to get a copy of this message
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 smalyshev@gmail.com

« previous php.internals (#87584) next »