FAQ

On 10/24/2013 12:41 PM, Nikita Popov wrote:
https://wiki.php.net/rfc/engine_exceptions
Very nice Nikita...

I like that this patch would provide for very little BC breakage. Given
Rowan's list, there would be some changes in behavior but I think that
the behavior would be desirable for those that have written their code
in this manner (that finally's and destructors will be called, etc).

It might even be likely that those who have written code in this manner
are not aware that their code isn't being unwound properly, I've run
across situations like this before and am always a little leery of
writing code that relies on destructors being called since it is not
perfectly reliable.

On the potential issues:
   +1 for BaseException
   -1 for E_RECOVERABLE becoming exceptions because of the BC breakage
(execution flow should continue on the next line)
   +1 for the final error message being reduced to Uncaught
EngineException...
   -1 for not all errors converted, if it's an error that occurs after
code execution has begun then they should all be converted for consistency.

On other ideas presented as comments:
   -1 for changing any current errors that let code execution continue
(E_WARNING, E_NOTICE, etc) into exceptions.

In the end, I think that the current RFC takes it to where it really
needs to be: proper unwinding of finally/destructors, better uncaught
fatal error information (stack traces). Some other languages go way too
far with exceptions and make writing anything in them consist of 30% of
the code being try/catch blocks rather than real code.

The only thing I would suggest is that it not being a single
EngineException, but a few well thought out sub-classes of EngineException.

-Clint

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

People

Translate

site design / logo © 2022 Grokbase