On Fri Nov 11 12:13 AM, Stas Malyshev wrote:
>
> > - MODE_DEBUG: This one can work together with the other two,
> > allowing a validation of class/interface/trait presence in the file.
> Basically,
> > it requires the file and then checks if the item exists in scope.
>
> Not sure debug adds much here - if the class is not found, you'll be
> notified by the engine anyway, so what's the added value?
>
Right there will be fatal by engine anyway "Class does exist.."
Our approach with autoloading has been the following:
spl_autoload_register('MV_Autoload');
function MV_Autoload($className)
{
try {
MV_Loader::classImport($className);
} catch(MV_ClassNotFound_Exception $e) {}
}
It seems very wrong to me to generate a fatal error on class_exists() & al.
That's unless the spl_autoload_register() api changes and allows to deal with
errors - require(), Exception, ...
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php