Re: [PHP-DEV] Interaction between finally blocks and exit()

2021-02-23 Thread Guilliam Xavier
On Tue, Feb 23, 2021 at 5:12 PM Nikita Popov wrote: > On Tue, Feb 23, 2021 at 4:52 PM Guilliam Xavier > wrote: > >> On Fri, Feb 5, 2021 at 2:10 PM G. P. B. wrote: >> >> > Greetings internals, >> > >> > While working on rewriting the PHP docs about errors and error handling >> [1] >> > I came ac

Re: [PHP-DEV] Interaction between finally blocks and exit()

2021-02-23 Thread Nikita Popov
On Tue, Feb 23, 2021 at 4:52 PM Guilliam Xavier wrote: > On Fri, Feb 5, 2021 at 2:10 PM G. P. B. wrote: > > > Greetings internals, > > > > While working on rewriting the PHP docs about errors and error handling > [1] > > I came across a change of behaviour in an edge case of an edge case. > > >

Re: [PHP-DEV] Interaction between finally blocks and exit()

2021-02-23 Thread Guilliam Xavier
On Fri, Feb 5, 2021 at 2:10 PM G. P. B. wrote: > Greetings internals, > > While working on rewriting the PHP docs about errors and error handling [1] > I came across a change of behaviour in an edge case of an edge case. > > finally blocks are meant to be always executed regardless that an Except

Re: [PHP-DEV] Interaction between finally blocks and exit()

2021-02-08 Thread Guilliam Xavier
Executing finally blocks after a die was discussed in https://externals.io/message/107497 "exit() via exception", but https://github.com/php/php-src/pull/5243 "Make exit() unwind properly" wasn't merged in 8.0, just https://github.com/php/php-src/pull/5768 "... (minimal version)". The change of be

Re: [PHP-DEV] Interaction between finally blocks and exit()

2021-02-05 Thread David Gebler
Interesting. I'm not sure there's a "correct" answer here, but FWIW on balance my feeling is the expectation that exit() will immediately terminate a script (registered shutdown functions and destructors aside) should take precedence over the expectation that finally blocks will always execute, jus

[PHP-DEV] Interaction between finally blocks and exit()

2021-02-05 Thread G. P. B.
Greetings internals, While working on rewriting the PHP docs about errors and error handling [1] I came across a change of behaviour in an edge case of an edge case. finally blocks are meant to be always executed regardless that an Exception has been thrown or not, which it does, however a call t