Hi,

I just found this strange behaviour in PHP5:

When using class_exists() to test, whether a class exists, the magic function __autoload() is called:

function __autoload($class)
{
  echo "Trying to load $class\n";
}

if (!class_exists('DB')) {
  echo "DB does not exist.\n";
}

You'll get:

Trying to load DB
DB does not exist.

Is this a bug or the desired behaviour? It's pretty annoying, when you are trying to use __autoload() as a fallback if a class could not be loaded from directories defined by the user...

Best regards,

Stephan
--
http://www.php-tools.net
http://www.schst.net
http://pear.php.net

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



Reply via email to