Hi,

Thanks  for this interesting and well-documented message.

When looking at the history about class friendship, you may have seen that the 
concept was globally rejected in favor of Guilherme's project of 
'package-privacy'. I personnally think friend classes are a different and more 
powerful concept and, if you feel strong enough to write and defend an RFC and 
defend it, I encourage you to go on.

These are details:

- I would prefer providing the same access to friend classes as parents and 
descendants : that is allow 'protected' but keep private reserved to the class. 
This way, when looking at the class code, you know that private data cannot be 
accessed, even by friends.

- I would extend the syntax to namespaces. For examples, '\MyNS\' (syntax to 
dicuss) would declare every class in the '\MyNS' namespaces or sub-namespaces 
as friends. Must support 'friend __NAMESPACE__' or something equivalent. This, 
coupled with a protected __construct() method would provide something quite 
similar to package-private access, but more extensible and powerful.

Regards

François

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to