Hi

On 5/9/24 17:18, Saki Takamachi wrote:
Is it nonsense to always stop processing even if an error occurs? Or, how about 
creating an uncatchable exception class specifically for exits? Or is this 
level of risk negligible?


This is already the case. `exit` throws an internal uncatchable Exception. Quoting from the RFC:

Finally, the need for exit() to be a language construct with its own dedicated 
opcode is not a requirement any more since PHP 8.0 as the opcode throws a 
special kind of exception which cannot be caught, 2) nor executes finally 
blocks, to unwind the stack normally.

Best regards
Tim Düsterhus

Reply via email to