Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32974 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11588 invoked by uid 1010); 24 Oct 2007 19:50:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11572 invoked from network); 24 Oct 2007 19:50:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2007 19:50:12 -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 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:60760] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/E8-47805-3F1AF174 for ; Wed, 24 Oct 2007 15:50:12 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 24 Oct 2007 21:50:08 +0200 Received: from [192.168.16.91] ([192.168.16.91]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 24 Oct 2007 12:50:04 -0700 Message-ID: <471FA1EC.1020305@zend.com> Date: Wed, 24 Oct 2007 12:50:04 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Chuck Hagenbuch CC: internals@lists.php.net References: <20071024154058.59923y3f6gjdw62o@technest.org> In-Reply-To: <20071024154058.59923y3f6gjdw62o@technest.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Oct 2007 19:50:04.0755 (UTC) FILETIME=[1282F230:01C81677] Subject: Re: [PHP-DEV] Autoloading namespace constants and functions From: stas@zend.com (Stanislav Malyshev) > A few different proposals have mentioned the possibility that import or > use statements might trigger autoload. I don't think it's a good idea. Import is a compile-time name transformation, it doesn't even have to be a name of any real class or namespace. > The missing piece would be allowing autoload to trigger when a > fully-qualified name was used whether that name was for a function, > class, or constant. That won't be autoload that we have now, but entirely different functionality, and I'm not sure many people would really need it. > ... but let do_stuff be a function in the My::Namespace namespace, not a > class method of the Namespace class in the My namespace. And how the engine is supposed to know which one do you mean? > situation, and namespaces almost get us there - I just can't make full > use of namespaced functions or namespace constants right now if I want > to do it. You can't autoload functions and constants - just as you couldn't before. That doesn't prevent you from using them - just as it didn't prevent you from using them before :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com