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
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php