Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89737 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46297 invoked from network); 8 Dec 2015 11:01:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2015 11:01:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=flaupretre@free.fr; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=flaupretre@free.fr; sender-id=unknown Received-SPF: error (pb1.pair.com: domain free.fr from 212.27.42.2 cause and error) X-PHP-List-Original-Sender: flaupretre@free.fr X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:20192] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/D5-31749-198B6665 for ; Tue, 08 Dec 2015 06:01:38 -0500 Received: from zimbra71-e12.priv.proxad.net (unknown [172.20.243.221]) by smtp2-g21.free.fr (Postfix) with ESMTP id 80D094B007A; Tue, 8 Dec 2015 12:00:31 +0100 (CET) Date: Tue, 8 Dec 2015 12:01:34 +0100 (CET) To: Dustin Wheeler Cc: internals@lists.php.net Message-ID: <348752699.466407212.1449572494594.JavaMail.root@zimbra71-e12.priv.proxad.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [217.108.162.120] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - FF3.0 (Win)/7.2.0-GA2598) X-Authenticated-User: flaupretre@free.fr Subject: Re: [PHP-DEV] Class Friendship in PHP From: flaupretre@free.fr References: 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 'packa= ge-privacy'. I personnally think friend classes are a different and more po= werful concept and, if you feel strong enough to write and defend an RFC an= d 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 c= lass. 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 t= o dicuss) would declare every class in the '\MyNS' namespaces or sub-namesp= aces as friends. Must support 'friend __NAMESPACE__' or something equivalen= t. This, coupled with a protected __construct() method would provide someth= ing quite similar to package-private access, but more extensible and powerf= ul. Regards Fran=C3=A7ois