Finally block is NOT executed

Assume that you have used a finally block after a try-catch block when working in PHP. In which of the given scenarios will the finally block NOT be executed?

1. A return statement is encountered inside either the try or the catch blocks.

2. The finally block contains a return statement.

Options
  1. Only 1
  2. Only 2
  3. Both 1 and 2
  4. Neither 1 nor 2

Related Posts