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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php