Q. What will be the output?
Code:
try {
throw new Exception('Error');
} catch (Exception $e) {
echo $e->getMessage();
}
β
Correct Answer: (A)
Error
Explanation: Exception message is printed using getMessage().