Re: Class Friendship in PHP

From: Date: Tue, 08 Dec 2015 11:13:04 +0000
Subject: Re: Class Friendship in PHP
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-89738@lists.php.net to get a copy of this message
Hi, ----- Mail original ----- De: guilhermeblanco@gmail.com > My biggest concern about supporting friend classes is the ability to access > non-intentional to be accessed code outside of the original class's > knowledge. This by itself is very dangerous. That's the opposite : the 'friend' keyword defines the classes which can access to your class, not the classes you can access to. As I already said, package-private is fine, but it restrict the scope to the same namespace. I agree that it will be the major case but friendship allows other cases. Regards François

« previous php.internals (#89738) next »