Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44556 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87964 invoked from network); 30 Jun 2009 17:56:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2009 17:56:43 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.117 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.117 us-mr1.zend.com Linux 2.4/2.6 Received: from [63.205.162.117] ([63.205.162.117:34105] helo=us-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/0C-52911-AD15A4A4 for ; Tue, 30 Jun 2009 13:56:43 -0400 Received: from us-gw1.zend.com (us-ex1.zend.net [192.168.16.5]) by us-mr1.zend.com (Postfix) with ESMTP id E0609E12C0 for ; Tue, 30 Jun 2009 10:45:39 -0700 (PDT) Received: from [192.168.16.83] ([192.168.16.83]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 30 Jun 2009 10:57:15 -0700 Message-ID: <4A4A51D8.7030504@zend.com> Date: Tue, 30 Jun 2009 10:56:40 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Michael Shadle CC: PHP Development References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Jun 2009 17:57:15.0676 (UTC) FILETIME=[33DFB5C0:01C9F9AC] Subject: Re: [PHP-DEV] Request for a function or constant to expose which namespace the current code is running under. From: stas@zend.com (Stanislav Malyshev) Hi! > If I'm looking for a specific function, and it's in two include files, > how do you know which namespace the function is written under? Some > sort of manual backtrace? Namespaces are local to files. > Is there a magic constant like __NAMESPACE__ or a function that can > return the name of the namespace the code is currently running under? "namespace the code is currently running under" is meaningless, since namespace is a compile-time concept. There is __NAMESPACE__ constant which is equal to currently compiles namespace. http://www.php.net/manual/en/language.namespaces.nsconstants.php -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com