I concur!

Andrey

Tobias Schlitt wrote:
Hi Zeev Suraski!
On 08/10/05 17:30 you wrote:


I think
that throwing exceptions in all sorts of places encourages people to
write 'exception-oriented' apps, which is very messy.


Sorry, but I consider that statement wrong. We are still talking about
PHP and a not caught exception will result into a fatal error. Therefore
you do not force anyone to actually write 'exception-oriented' apps.


I believe we mentioned once the possibility of adding another error
level, which is fatal - but still catchable by set_error_handler().


What actually would be the same as having a try block around your
application.


That is a good idea (which we should be doing either way).


I definitly agree here, but it does not make sense for type hinting.

But heaving the type hints throwing an exception  is a really nice
feature for large applications, where you are often not sure, which
parts of the application will call a function or even worse you're not
sure with which objects you act (because of utilizing multiple different
libraries, written be even more different people). Having an exception
thrown in that case enables you to run surrounded, independant modules
to finish their work gracefully instead of shutting down the whole
request gracefully.

The actual implementation of type hints does not allow them to be used
in this case, because having a coding error in just 1 module will screw
up all other modules, where just 1 is broken.

Regards,
Toby

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

Reply via email to