Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33984 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25366 invoked by uid 1010); 13 Dec 2007 04:40:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 25350 invoked from network); 13 Dec 2007 04:40:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2007 04:40:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@smashlabs.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@smashlabs.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain smashlabs.com from 67.15.58.61 cause and error) X-PHP-List-Original-Sender: ralph@smashlabs.com X-Host-Fingerprint: 67.15.58.61 openrce.org Linux 2.6 Received: from [67.15.58.61] ([67.15.58.61:34491] helo=users.smashlabs.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/51-12141-3C7B0674 for ; Wed, 12 Dec 2007 23:40:36 -0500 Received: (qmail 16295 invoked from network); 12 Dec 2007 22:40:32 -0600 Received: from localhost (HELO ?127.0.0.1?) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 12 Dec 2007 22:40:32 -0600 Message-ID: <4760B7BF.8080102@smashlabs.com> Date: Wed, 12 Dec 2007 22:40:31 -0600 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: Jeff Moore CC: internals References: <47606C70.3050202@smashlabs.com> <6D0F3834-16E8-46C1-9D3E-8A588BF1A5A6@procata.com> In-Reply-To: <6D0F3834-16E8-46C1-9D3E-8A588BF1A5A6@procata.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Namespace access modifiers From: ralph@smashlabs.com (Ralph Schindler) Jeff Moore wrote: > I don't think properties are the appropriate level to specify namespace > based access modifiers. I do think that a coarse-grained access > restriction on a class by class basis might be. Perhaps you are right, but I was using that as an example. I actually see great value in being able to declare a specific method inside a calls of a component/namespace as namespace-protected. Alot of times you see that objects within a given component might do something like: class Foo_Bar { protected $_someProperty = null; public function _setSomeProperty($value) { $this->_someProperty = $value } } as a means to describe that an object of type Foo_Baz can interact with Foo_Bar, but Foo_Bar::_setSomeProperty() should not be considered a safe method to be called by a developer from an API standpoint. Wouldn't that be nice? > pseudo-type? I just don't see how it could work in practice. Wouldn't it work the same way as protected methods work? Essentially, protected methods ensure that the caller is in the inheritance (is_a) chain. This would simple add a new check (for methods marked nsprotected) to check to ensure that the caller is a derivative of a specific namespace. -ralph