On Mon, Jul 6, 2009 at 6:49 AM, Ben Bidner<b...@vuetec.com> wrote:

> <?php
>
>   function autoloader($className)
>   {
>      throw new Exception("Fail");
>   }
>
>   spl_autoload_register("autoloader");

The whole point of spl_autoload_register() is to allow programmers to
have several independent autoloaders. So, it is a bad practice to
throw exception from autoload — doing so, you forbid system to try the
next autoloader.

Good practice is: if you can't load class from autoloader — just
silently return from it

-- 
Alexey Zakhlestin
http://www.milkfarmsoft.com/

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

Reply via email to