Hi folks,

Just looking for a quick clarification on how class constant look ups are
performed internally under circumstances when an autoload function is also
called.


Consider the following example:

<?php

   function autoloader($className)
   {
      throw new Exception("Fail");
   }

   spl_autoload_register("autoloader");

?>

<?php

   // Exception
   $obj = new NonExistantClass;

?>

<?php

   // Fatal error
   $const = NonExistantClass::NON_EXISTANT_CONSTANT;

?>

I would have assumed that since the autoloader threw an exception while
attempting to load the non existant class, that internally, there would be
no attempt to access the non existant constant (since surely that comes
after the exception was thrown???) and we would get the Exception, rather
than a Fatal error.

Intended or a design error?


Ben Bidner

+61.7.3161.2000 (office) | +61.7.3009.0651 (fax) | +61.4.3201.5362 (mobile)
http://www.vuetec.com/



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

Reply via email to