Advanced
PHP
Q96 / 100
What is PHP's match expression behavior with no matching arm?
Correct! Well done.
Incorrect.
The correct answer is B) Throws UnhandledMatchError, unlike switch which falls through to the end silently
B
Correct Answer
Throws UnhandledMatchError, unlike switch which falls through to the end silently
Explanation
match($val) without a default that covers all cases throws UnhandledMatchError when no arm matches. This is intentional — use default to handle unexpected values explicitly.
Progress
96/100