Re: [RFC] Supports 'finally' keyword for PHP exceptions
| From: | Rasmus Lerdorf | Date: | Tue, 24 Jul 2012 15:16:23 +0000 |
| Subject: | Re: [RFC] Supports 'finally' keyword for PHP exceptions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61689@lists.php.net to get a copy of this message | ||
On 07/24/2012 06:35 AM, Nikita Popov wrote:
> On Tue, Jul 24, 2012 at 1:20 PM, Laruence <laruence@php.net> wrote:
>> Hi:
>> As the previous threads disscussed, I make a implemention.
>>
>> here is the RFC: https://wiki.php.net/rfc/finally
>>
>> any suggestions?
>
> The finally clause comes with a very strong promise that the code in
> the clause will run in absolutely any case (short of sigkill, maybe).
No it doesn't, at least not in Java. A fatal Java error or an explicit
call to System.exit() will cause the finally clause to not be executed.
It is a simple exception-level construct and doesn't in any way promise
to be called in a fatal error situation. And regardless of what Java
does, we are free to define it and provide whatever promises we want
here, but keeping it in line with Java's implementation makes sense to me.
-Rasmus