Zend
200-530 · Question #189
What is the output of the following code? try { class MyException extends Exception {}; try { throw new MyException; } catch (Exception $e) { echo "1:"; throw $e; }c atch (MyException $e) { echo…
The correct answer is E. 1:MyException. Zend 200-530 Exam
Performance Monitoring and Troubleshooting
Question
What is the output of the following code? try { class MyException extends Exception {}; try { throw new MyException; } catch (Exception $e) { echo "1:"; throw $e; }c atch (MyException $e) { echo "2:"; throw $e; }} catch (Exception $e) { echo get_class($e); }
Options
- AA parser error, try cannot be followd by multiple catch
- B1:
- C2:
- D1:Exception
- E1:MyException
- F2:MyException
- GMyException
How the community answered
(71 responses)- B3% (2)
- C6% (4)
- E80% (57)
- F1% (1)
- G10% (7)
Explanation
Zend 200-530 Exam
Topics
#PHP#exception handling#inheritance#try-catch
Community Discussion
No community discussion yet for this question.