πŸ“Š PHP
Q. What will be the output?
Code:
try {
  throw new Exception('Error');
} catch (Exception $e) {
  echo $e->getMessage();
}
  • (A) Error
  • (B) Exception
  • (C) Nothing
  • (D) Fatal Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) Error

Explanation: Exception message is printed using getMessage().

Explanation by: Roshan
Exception message is printed using getMessage().

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
2
Total Visits
πŸ“½οΈ
8 d ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
93%
Success Rate