Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89027 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18705 invoked from network); 1 Nov 2015 19:35:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2015 19:35:55 -0000 X-Host-Fingerprint: 176.25.179.123 unknown Received: from [176.25.179.123] ([176.25.179.123:25108] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/98-13635-A9966365 for ; Sun, 01 Nov 2015 14:35:54 -0500 Message-ID: <31.98.13635.A9966365@pb1.pair.com> To: internals@lists.php.net References: Date: Sun, 1 Nov 2015 19:35:50 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 176.25.179.123 Subject: Re: Friend class/function From: ajf@ajf.me (Andrea Faulds) Hi Georges, georges wrote: > ​Hi php internals, > > I recently discovered ​the "friendship concept" in c++ and i really love > the concept. > And i wonder if the php internals would be interested to implements it in > the next 7.x major version. I recently wished PHP had this feature when trying to implement the Khronos Group Typed Arrays specification in PHP, which requires sharing certain data between unrelated (inheritance-wise) classes. I ended up having to expose a public method to get the data, but named in a way that was likely to deter use. I think friend classes might be useful, then. I'm not sure if they're necessarily something we should add to HPP, though. Are there that many use-cases? Thanks. -- Andrea Faulds http://ajf.me/