PHP Exception Handling MCQs

This section focuses on "Exception Handling" in PHP. These Multiple Choice Questions (mcq) and answers should be practiced to improve the PHP skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exam and other competitive examinations.

1. In Which php version Exception handling was added?

A. PHP 5.1
B. PHP 5.2
C. PHP 5.3
D. PHP 5

View Answer


2. How many methods are available for the exception class?

A. five
B. six
C. seven
D. eight

View Answer


3. what is try block do?

A. It represent block of code in which exception can arise.
B. It is used in place of catch block or after catch block .
C. It is used to throw an exception.
D. None of the above

View Answer


4. what is finally block do?

A. It represent block of code in which exception can arise.
B. It is used in place of catch block or after catch block .
C. It is used to throw an exception.
D. None of the above

View Answer


5. what is throw block do?

A. It represent block of code in which exception can arise.
B. It is used in place of catch block or after catch block .
C. It is used to throw an exception.
D. None of the above

View Answer


6. Which of the following statements invoke the exception class?

A. throws new Exception();
B. throw new Exception();
C. new Exception();
D. new throws Exception();

View Answer


7. Why Exception Handling in PHP used?

A. Separation of error handling code from normal code
B. Grouping of error types
C. Both A And B
D. None of the above

View Answer


8. Which of the following is not specialized keywords in exception handling.

A. try
B. catch
C. throw
D. this

View Answer


9. How many error levels are available in PHP?

A. 14
B. 15
C. 16
D. 17

View Answer


10. What is the description of Error level E_ERROR?

A. Fatal run-time error
B. Near-fatal error
C. Compile-time error
D. Fatal Compile-time error

View Answer





Also check :


Discussion


* You must be logged in to add comment.