Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21472 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98605 invoked by uid 1010); 11 Jan 2006 09:06:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98590 invoked from network); 11 Jan 2006 09:06:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2006 09:06:52 -0000 X-Host-Fingerprint: 213.136.52.68 mailgate-out2.mysql.com Linux 2.5 (sometimes 2.4) (4) Received: from ([213.136.52.68:60154] helo=mailgate.mysql.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A2/10-29075-BAAC4C34 for ; Wed, 11 Jan 2006 04:06:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate.mysql.com (8.13.4/8.13.4) with ESMTP id k0B96mDm019555; Wed, 11 Jan 2006 10:06:48 +0100 Received: from mail.mysql.com ([10.222.1.99]) by localhost (mailgate.mysql.com [10.222.1.98]) (amavisd-new, port 10026) with LMTP id 29047-04; Wed, 11 Jan 2006 10:06:48 +0100 (CET) Received: from [10.100.72.16] (10-100-72-16.mysql.internal [10.100.72.16]) by mail.mysql.com (8.13.3/8.13.3) with ESMTP id k0B96hCZ008105; Wed, 11 Jan 2006 10:06:43 +0100 Message-ID: <43C4CAA1.7040807@php.net> Date: Wed, 11 Jan 2006 10:06:41 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051219 SeaMonkey/1.0b MIME-Version: 1.0 To: Greg Beaver CC: Leon Matthews , internals@lists.php.net References: <43C48BB4.2040303@php.net> In-Reply-To: <43C48BB4.2040303@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailgate.mysql.com Subject: Re: [PHP-DEV] Support for friend classes From: hartmut@php.net (Hartmut Holzgraefe) Greg Beaver wrote: > By definition, if you're accessing it from another class, then perhaps > it isn't "private" at all. in C++ "friend" gives access to both "private" and "protected" ... > This can be more easily and intuitively > solved by using protected and CoderTest extends Coder, given that PHP doesn't have multiple inheritance this just doesn't work out all the time, so this would actually be an argument *for* "friend" in PHP > or just making it > public and documenting in the code where it should and should not be used. this argument can easily be extended to "don't use the PPP stuff at all" "friend" on the other hand is a mechanism to allow more fine grained access control "friend" extends PPP in a similar way as ACLs extend the unix file access control mechanisms "user/group/others" concept ... -- Hartmut Holzgraefe, Senior Support Engineer . MySQL AB, www.mysql.com