Zend
200-710 · Question #230
200-710 Question #230: Real Exam Question with Answer & Explanation
The correct answer is C. `catch (MyException | TheirException $e)`. See the full explanation below for the reasoning.
Question
Given the following PHP code:
<?php
class MyException extends Exception {
//
}
try {
throw new MyException('something went wrong');
} *** {
echo $e->getMessage();
}
?>
Which code, if put on place of '***', will NOT prompt the code to output "something went wrong" when run?Options
- A
catch (Exception $e) - B
catch (MyException $e) - C
catch (MyException | TheirException $e) - D
catch (Error $e)
Community Discussion
No community discussion yet for this question.