LAUPRETRE François (P) wrote:
From: Stut [mailto:[EMAIL PROTECTED] This would need to come from the user implementation of __autoload through naming conventions or a lookup table. PHP does not get involved with resolving a type to a filename, and rightly so.

The question is not to have PHP get involved in the symbol to filename 
correspondance.

I have a lookup table, but the requested type must come from the interpreter 
context and, if the autoload handler does not get it, it cannot know what type 
to look for in its lookup table. Unfortunately, even if not very common, a 
function and a class can have the same name. In this case, there will be two 
entries in the lookup table. If I don't know which type is requested, I can 
only search all known types. Maybe it would be enough but it wouldn't be 
elegant nor efficient, especially if we extend the mechanism to functions and 
constants.

I agree that if the autoload mechanism were extended to functions and constants (which I am opposed to, not that anyone will care) there would need to be a type provided to __autoload so it knew what it was looking for. However, this surely doesn't apply to classes and interfaces since the interpreter has no way of knowing and no reason to care what a particular symbol is since the two are interchangeable.

-Stut

--
http://stut.net/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to