try {
throw new Exception("boom");
} catch (Exception $e) {
echo "caught: " . $e->getMessage();
}What is printed?
- acaught: boom✓
- bboom
- cFatal error: uncaught exception
- dNothing is printed
Explanation:The thrown Exception has message "boom". The catch block matches Exception and echoes the literal prefix plus getMessage(), producing "caught: boom".