Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66362 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96443 invoked from network); 28 Feb 2013 20:37:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2013 20:37:23 -0000 Authentication-Results: pb1.pair.com header.from=steve@mrclay.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=steve@mrclay.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mrclay.org from 50.22.11.19 cause and error) X-PHP-List-Original-Sender: steve@mrclay.org X-Host-Fingerprint: 50.22.11.19 bedford.accountservergroup.com Received: from [50.22.11.19] ([50.22.11.19:40792] helo=bedford.accountservergroup.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/8E-25879-100CF215 for ; Thu, 28 Feb 2013 15:37:22 -0500 Received: from n128-227-81-208.xlate.ufl.edu ([128.227.81.208]:64527 helo=Distance-Ed-Sclay.local) by bedford.accountservergroup.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1UBAEB-000D4E-31 for internals@lists.php.net; Thu, 28 Feb 2013 14:37:19 -0600 Message-ID: <512FBFFE.4000604@mrclay.org> Date: Thu, 28 Feb 2013 15:37:18 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: PHP Internals References: <7E088EEC-ACB7-4977-BE00-CEA17ABD6EC3@me.com> In-Reply-To: <7E088EEC-ACB7-4977-BE00-CEA17ABD6EC3@me.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bedford.accountservergroup.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mrclay.org Subject: Re: [PHP-DEV] I would like to write an RFC for the addition of an internal keyword From: steve@mrclay.org (Steve Clay) Setting aside difficulty of implementation, I'm coming around to the idea, though I think you could simplify it by cordoning off an entire namespace. E.g.: A namespace at least two deep (e.g. \A\B\) may be marked 'protected' (by some method TBD). Classes and functions declared in a protected namespace can only be accessed from methods or functions inside the same namespace, or in ancestor namespaces. E.g., if \Foo\Internal\ is protected, access of its classes/functions must originate from classes/functions defined in \Foo\, \Foo\Internal\, or \Foo\Internal\*. This would allow something like nested classes, but obviously with a lot more flexibility. In practice, plugin code sitting in, say, \MyPlugin\ could freely access \Framework\SomeClass, but not \Framework\Internal\SomeClass. I see some value there, but there's tons of questions remaining and how to to implement the damn thing... Steve Clay -- http://www.mrclay.org/ On 2/28/13 1:56 AM, Jens Riisom Schultz wrote: > * In response to the argument that php has no assembly concept: > I know this, but namespaces are as close as we get, and would effectively solve this.