Re: [PATCH] in_class_exists() for detecting __autoload() called by class_exists() and interface_exists()

From: Date: Wed, 03 Oct 2007 21:54:02 +0000
Subject: Re: [PATCH] in_class_exists() for detecting __autoload() called by class_exists() and interface_exists()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32621@lists.php.net to get a copy of this message
to use die() or some other method of terminating execution. A user calling class_exists() clearly expects a return from autoload, whereas a user instantiating an object will expect a fatal error if the class cannot be found.
This is true, but __autoload should never do it, the engine should do it. So I think it's better just not make autoloader *ever* produce errors. Can't find it - just give up, if engine really needs it it'd bail out :)
This is useful for PEAR2 as a means of displaying helpful information on locating missing class files only in cases where a fatal error would result anyways.
Well, autoloader might print debug traces etc. if the developer wants it, but I don't see why this should be unique feature for class_exists. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32621) next »