Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28407 invoked from network); 5 Nov 2008 23:34:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2008 23:34:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 74.125.92.25 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 74.125.92.25 qw-out-2122.google.com Received: from [74.125.92.25] ([74.125.92.25:10858] helo=qw-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/BC-22938-76D22194 for ; Wed, 05 Nov 2008 18:33:59 -0500 Received: by qw-out-2122.google.com with SMTP id 8so181352qwh.59 for ; Wed, 05 Nov 2008 15:33:57 -0800 (PST) Received: by 10.215.41.7 with SMTP id t7mr1511443qaj.135.1225928036908; Wed, 05 Nov 2008 15:33:56 -0800 (PST) Received: from ?192.168.0.106? ([76.84.4.101]) by mx.google.com with ESMTPS id 26sm246244qwa.8.2008.11.05.15.33.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 05 Nov 2008 15:33:55 -0800 (PST) Message-ID: <49122D6E.5080405@chiaraquartet.net> Date: Wed, 05 Nov 2008 17:34:06 -0600 User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Ryan Panning , internals@lists.php.net References: <29.7A.15458.C4880194@pb1.pair.com> <5C.FA.15458.9A980194@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Namespace Resolution From: greg@chiaraquartet.net (Gregory Beaver) Lukas Kahwe Smith wrote: > > On 04.11.2008, at 18:43, Ryan Panning wrote: > >> Just to make my post clear, I'm in favor of this approach for >> non-qualified calls in a namespace. >> >> 1. global >> 2. autoload >> 3. fail > > > A couple of us (Hannes, Stas, Derick, Matt Wilson and I) were just > chatting on IRC and we all favor the following: > > 1) ns 2) autoload (for classes) and global (for functions/constants) 3) > fail > > So no fallback to the global namespace for classes, but fallback for all > functions/constants (regardless of internal or not) Independently, I made this patch yesterday to do what you're describing. http://pear.php.net/~greg/resolv.patch.txt It turns out that we already fallback to all global constants (not just internal ones). Only functions and classes were falling back to internal-only. Once someone reviews and commits we can focus solely on bugfixes for namespaces and finally get out alpha3 within a week (my guesstimate, based on what things look like). Regarding the patch: it is minimal changes for class name resolution. It only removes the lines that tell the engine to do fallback for classes. We may also want to remove the few lines of functionality that does fallback to internal for classes in zend_fetch_class, but I'd rather wait on that, and do a full review of the way those constants are being used in ZEND_FETCH_CONSTANT and all the other 5 places constants are resolved, as I recycled some constants, which could use some renaming. The patch also does not update any tests, some of which should fail. Thanks, Greg