Re: RE : Namespaces and __autoload()

From: Date: Wed, 12 Sep 2007 16:48:04 +0000
Subject: Re: RE : Namespaces and __autoload()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32297@lists.php.net to get a copy of this message
Yes. PHK's autoload handler is not filename-based. It works as a (poor man's :) runtime linker, with a symbol map. In this map, interfaces and classes have different symbol types. Today, when this handler receives a request, it cannot know if it should look for an interface or a class. So, it has to search both in turn.
Looks like design flaw to me - why not index symbols by name, you can't have interface and class with the same name?
very interesting to extend the feature to functions and, there, providing the symbol type along with the requested value becomes mandatory.
If we ever extend autoloader to functions, it would be different autoloader anyway, since existing autoloaders can't support functions. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32297) next »