Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20567 invoked from network); 9 Mar 2011 15:18:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2011 15:18:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=james.butler@edigitalresearch.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=james.butler@edigitalresearch.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain edigitalresearch.com from 217.154.180.62 cause and error) X-PHP-List-Original-Sender: james.butler@edigitalresearch.com X-Host-Fingerprint: 217.154.180.62 analysis.edigitalresearch.com Received: from [217.154.180.62] ([217.154.180.62:59239] helo=mail.edigitalresearch.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/07-21312-43A977D4 for ; Wed, 09 Mar 2011 10:18:12 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.edigitalresearch.com (Postfix) with ESMTP id 57AD9220CC0 for ; Wed, 9 Mar 2011 15:12:26 +0000 (GMT) X-Virus-Scanned: amavisd-new at edigitalresearch.com Received: from mail.edigitalresearch.com ([127.0.0.1]) by localhost (mail.edigitalresearch.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zmcXl3zXlqoQ for ; Wed, 9 Mar 2011 15:12:25 +0000 (GMT) Received: from zarafa.localdomain (unknown [10.0.0.20]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.edigitalresearch.com (Postfix) with ESMTPS id 5D73D220BCA for ; Wed, 9 Mar 2011 15:12:25 +0000 (GMT) Received: from [10.0.1.69] (unknown [10.0.1.69]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by zarafa.localdomain (Postfix) with ESMTPS id E72C010021A for ; Wed, 9 Mar 2011 15:12:24 +0000 (GMT) Message-ID: <4D779A4F.8030305@edigitalresearch.com> Date: Wed, 09 Mar 2011 15:18:39 +0000 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: internals@lists.php.net References: <8423995CEEEA844CB2F964B14BCA94CD043ABC80@PRODEXCHANGE02.ilchildcare.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Class Access Modifiers From: james.butler@edigitalresearch.com (James Butler) >> Proposal (after five minutes of thought) >> >> >> 1. Public - A class can be instantiated or called statically from >> anywhere. For reasons of backward compatibility a class without any modifier >> would be considered public. >> >> 2. Internal - A class can only be instantiated/called from within the >> same root namespace. If I have a class Core\Mvc\View, only from within a >> class sharing the same root namespace (ex: Core\Html\Textbox) would I be >> able to access the "View" class. >> >> 3. Private - A class can only be instantiated/called from within the >> exact same namespace. Example, class Core\Mvc\View could only be accessed >> from a class in the Core\Mvc namespace (ex: Core\Mvc\Controller). >> >> What do people think? I'm not too concerned with the exact three I listed >> above, but more and more I think it would be wise if there were a way to >> restrict the accessibility of classes between namespaces. >> >> Jarrod Nettles >> Really like the general idea and think (IMHO) its RFC worthy, but have a few questions... Would there be any method of overriding the the visibility in a child class?And would the child class inherit the parents visibility? I realise this may seem daft initially but I can think of some instances where this might be useful. James