Re: Casting of objects to array exports private/protected data
| From: | Christian Schneider | Date: | Sun, 18 Jan 2004 22:42:35 +0000 |
| Subject: | Re: Casting of objects to array exports private/protected data | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7172@lists.php.net to get a copy of this message | ||
Andrey Hristov wrote:
casting an object to array gives the possibility to get the values of protected/private member variables : IMO, when casting to array with (array) only the public-ly visible members should returned.Public/protected/private is there to protect you from bugs due to name clashes when you extend classes. It is not a sandbox to protect you from 'malicous' programmers. And I like it that way: PINJ(Y) - PHP is not Java (yet) Even though some people push it that way ;-) - Chris