Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89035 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71913 invoked from network); 2 Nov 2015 11:03:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Nov 2015 11:03:10 -0000 X-Host-Fingerprint: 178.62.40.5 ajf.me Received: from [178.62.40.5] ([178.62.40.5:8309] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/A3-42726-DE247365 for ; Mon, 02 Nov 2015 06:03:09 -0500 Message-ID: To: internals@lists.php.net References: <31.98.13635.A9966365@pb1.pair.com> <56372BF6.9000901@gmail.com> Date: Mon, 2 Nov 2015 11:03:05 +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: <56372BF6.9000901@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 178.62.40.5 Subject: Re: [PHP-DEV] Re: Friend class/function From: ajf@ajf.me (Andrea Faulds) Hi Rowan, Rowan Collins wrote: > Andrea Faulds wrote on 01/11/2015 19:35: >> 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. > > Would "package" (namespace-based) visibility have solved the problem in > this case? That's something I've often wanted - "this is public within > this Lib, but should never be used outside it". Yep, that would have worked, and that sounds like a much cleaner solution. Package/namespace visibility would solve a bunch of other use-cases too. Thanks! -- Andrea Faulds http://ajf.me/