Re: [PATCH] in_class_exists() for detecting __autoload() called by class_exists() and interface_exists()
| From: | Gregory Beaver | Date: | Wed, 03 Oct 2007 23:17:22 +0000 |
| Subject: | Re: [PATCH] in_class_exists() for detecting __autoload() called by class_exists() and interface_exists() | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-32623@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
>> 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 :)
Another possibility: could there be a way to add context information (a
string) to the error message the engine displays? This would alleviate
my concern.
>> 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.
the point is that if the user is using class_exists() they don't want
extra output on missing class.
Greg