Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30450 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12372 invoked by uid 1010); 4 Jul 2007 19:18:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12357 invoked from network); 4 Jul 2007 19:18:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2007 19:18:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.114 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.114 unknown Windows 2000 SP4, XP SP1 Received: from [63.205.162.114] ([63.205.162.114:30366] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/F2-25128-2A2FB864 for ; Wed, 04 Jul 2007 15:18:58 -0400 Received: from [127.0.0.1] ([192.168.17.19]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 4 Jul 2007 12:18:54 -0700 Message-ID: <468BF29D.3000907@zend.com> Date: Wed, 04 Jul 2007 12:18:53 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Stefan Priebsch CC: internals@lists.php.net References: <002b01c7be39$4b1eee00$737a81d4@thinkpad> <468BB47E.8050205@e-novative.de> In-Reply-To: <468BB47E.8050205@e-novative.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Jul 2007 19:18:54.0989 (UTC) FILETIME=[29C74BD0:01C7BE70] Subject: Re: [PHP-DEV] Simple Namespace Proposal From: stas@zend.com (Stanislav Malyshev) > I take it that when I include or conditionally include, the included > file has its own namespace, if one is declared in that file. What if I > do not declare a namespace in an include file? Does this file "inherit" > the current namespace or are the contents added to the global namespace? No, namespaces are per-file. No namespace means global namespace. Non-local namespaces can be very problematic for bytecode caches since it would not be possible to know "true" names of the classes per-file and actually same file could generate very different names. > Could this result in name conflicts when including files that have their > own import statements? Note that import defines local (per-file) name transformation. I.e. if you do import Zend::Some::Class as Myclass, it means in this file, once you say Myclass, you actually mean Zend::Some::Class. But it should not have any effects on other files. > Does this mean that a programmer could "override" an internal PHP > function, possibly accidentally? Yes, it would be possible to "override" internal functions in namespace. I don't think it's too much of a problem - tools can deal with it. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com