PHP equivalent of friend or internal
PHP doesn’t support any friend-like declarations. It’s possible to simulate this using the PHP5 __get and __set methods and inspecting a backtrace for only the allowed friend classes, although the code to do it is kind of clumsy. There’s some sample code and discussion on the topic on PHP’s site: class HasFriends { private $__friends … Read more