PHP - Error and Exception Handling
Why does the finally block run even if there is a return statement inside the try or catch block?
Why does the finally block run even if there is a return statement inside the try or catch block?
finally blockfinally is meant to run cleanup or final steps no matter how the try-catch ends.returnreturn is called, finally runs before the function actually returns.finally runs to execute cleanup regardless of block exit. -> Option Bfinally always runs for cleanup [OK]finally runs for cleanup even with return [OK]return skips finallyfinally runs only without exceptionsfinally with catch15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions