RE : RE : Namespaces and __autoload()

From: Date: Thu, 13 Sep 2007 09:43:17 +0000
Subject: RE : RE : Namespaces and __autoload()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32306@lists.php.net to get a copy of this message
> From: Stanislav Malyshev [mailto:stas@zend.com] > > Looks like design flaw to me - why not index symbols by name, > you can't > have interface and class with the same name? Right. I was wrong and I have suppressed the 'interface' type in the PHK autoloader. > If we ever extend autoloader to functions, it would be different > autoloader anyway, since existing autoloaders can't support functions. Are you sure we would need to create a new hook ? If the existing autoload handlers receive a request for a function, they search for a class with that name. Apart from a waste of time, it is harmless. We can even have BC : you just have to declare your autoload handler with an optional second argument, whose default value is 'class'. This would allow new autoload handlers to run on previous PHP versions. Francois

« previous php.internals (#32306) next »