Re: [PHP-DEV] Access of protected members

2015-08-03 Thread Stanislav Malyshev
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 i

RE: [PHP-DEV] Access of protected members

2015-08-03 Thread Christian Stoller
From: Nicolai Scheer [mailto:nicolai.sch...@gmail.com], Sent: Monday, August 03, 2015 11:39 AM > > Hi, > > just stumbled upon a strange issue. > I always thought that protected/private member variables can only be > altered from inside the object. > > This example shows, that this is not true: >

Re: [PHP-DEV] Access of protected members

2015-08-03 Thread Rowan Collins
On 3 August 2015 10:39:05 BST, Nicolai Scheer wrote: >Hi, > >just stumbled upon a strange issue. >I always thought that protected/private member variables can only be >altered from inside the object. Yeah, as far as I know, PHP has always interpreted private and protected as "available to this c