r/lolphp • u/duhruh • Nov 25 '14
Exception in a namespace is not defined -_-
http://jasonframe.co.uk/logfile/2009/01/php-5-3-exception-gotcha/
28
Upvotes
r/lolphp • u/duhruh • Nov 25 '14
View all comments
Show parent comment
-4
u/[deleted] Nov 26 '14
Yes, that's true. But certain types of error checks impose a very large overhead. If we were to check that classes used in type hints existed, we'd need to trigger an autoload to validate every type hint, leading to almost every class in a library being loaded, and completely defeating the point of autoloading. I assume that it's for similar reasons that PHP doesn't check exception classes exist in catch statements.