Hi,

> From: Dmitry Stogov [mailto:[EMAIL PROTECTED] 
> 
> The patch provides an additional boolean argument to 
> __autoload() that say if class is really required. In case if 
> it false, user code shouldn't emit errors or throw exceptions.

Actually, an autoload handler should never emit errors or throw exceptions. 
With handlers registered through SPL, it is already the case. When using an 
__autoload() functions, raising an error when a symbol is not found is useless 
because we know that the PHP interpreter will do it. So, I propose to have PHP 
ignore any error or exception raised from autoload handlers. This would make 
the additional argument useless.

Actually, I also wanted to add a second argument to autoload handlers. It would 
give the type of the symbol we are looking for. Today, we are unable to know if 
we are searching for a class or an interface. So, an autoload handler like 
PHK's has to try both. It is not very important because most existing autoload 
handlers are so primitive (generally filename-based) that they treat both the 
same way. But, in the future, if we extend autoloading to functions and 
constants, we will need this argument. I cannot work on that now but, as you 
are considering modifying the autoload handler arguments, I thought you could 
be interested.

Regards

Francois

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

Reply via email to