Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16320 invoked from network); 2 Sep 2013 07:34:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2013 07:34:11 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.83 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.83 smtp83.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.83] ([108.166.43.83:60206] helo=smtp83.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/62-32023-F6F34225 for ; Mon, 02 Sep 2013 03:34:10 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp3.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 674B6500D4; Mon, 2 Sep 2013 03:34:05 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp3.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id EB5195008C; Mon, 2 Sep 2013 03:34:04 -0400 (EDT) Message-ID: <52243F6C.7070806@sugarcrm.com> Date: Mon, 02 Sep 2013 00:34:04 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Anthony Ferrara CC: Nicolas Grekas , "internals@lists.php.net" References: <5220262A.6040702@sugarcrm.com> <5220437A.7050008@sugarcrm.com> <5220D212.3010101@sugarcrm.com> <61FCD6C4A31248078FEAD2BA73D7CD44@gmail.com> <7AF31CC1D1554454AC95AE758D23E92E@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Function autoloading From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > namespace foo { > use function biz\buz; > use foo\bar; > > something(); // autoloaded as "something" Wait, so it wouldn't work like class autoloader, using fully qualified name? And autoloader would not then have any information about namespaces, so you'd have to specify explicit imports or full namespace names for any namespaced functions you use in your code? That doesn't sound very practical. It's much easier to do one require than to import manually each function in the namespace and requiring to explicitly name all of them removes half of the usefulness of namespaces - if you wanted all the full names, you could use very_long_names_like_this() as before. I think we discussed all these problems last time function autoloading topic came up. Also it is weird that namespace name is added to bar\baz() but not to bar(). This is contrary to how namespaces work in other places - where namespace name is added to everything not fully quailified. > Does that make sense? Frankly, for me it doesn't. Now I recall namespaces resolution and fallbacks was one of the reasons why function autoloading proposal failed the last time. IMHO this is a pretty big problem for practical usage of this - as pretty much the only case for function autoloading is resting on namespaces, so if autoloader can't deal with namespaced resolution rules, it's not good. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227