Re: strange autoload behavior

From: Date: Thu, 10 Jul 2008 08:38:54 +0000
Subject: Re: strange autoload behavior
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-38894@lists.php.net to get a copy of this message
YOu'd be surprised sometimes ;-) Anyway, exceptions thrown during autoload are ignored. Autoloading is the last resort for the engine to find a class. If the class can not be loaded (file isn't there, exception, autoloader doesn't load a file), then you get the fatal error. This is correct behavior. Yes, I read that exception can not be catched from autoload, but one thing was which confused me in this case:
<?php define('error', oops_i_left_the_quotes); class foo { } ?> In this case I got bar not found. <?php class foo { const error = oops_i_left_the_quotes; } ?> In this case I got the exception. So the difference is that class level constants are creating after the autoload? Best Regards, Felhő

« previous php.internals (#38894) next »