Which keyword is used to execute a block of code regardless of whether an exception was thrown?
- try...except
- finally
- always
- unless
The finally keyword is used to execute a block of code regardless of whether an exception was thrown. This is useful for cleanup operations.
Loading...
Related Quiz
- PHP provides a function named ________ to get the current date and time.
- What are some common use cases for network functions in PHP?
- Associative arrays in PHP use numeric keys.
- Which of the following best describes PHP?
- Consider a scenario where a user provides input that your PHP script tries to decode as JSON, but it's not valid JSON. Which function can help you identify the nature of the error?