PHP

PHP

Exception Handling has 10 Questions

Which version of PHP was added with Exception handling?

PHP 4
PHP 5
PHP 5.3
PHP 6
How many methods are available for the exception class?

5
6
7
8
Which version added the method getPrevious()?

PHP 4
PHP 5
PHP 5.1
PHP 5.3
Which of the following statements invoke the exception class?

throws new Exception();
throw new Exception();
new Exception();
new throws Exception();
Which one of the following is the right description for the method getMessage() ?

Returns the message if it is passed to the constructor.
Returns the message if it is passed to the class.
Returns the message if it is passed to the file.
Returns the message if it is passed to the object.
You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as..

protected
final
static
private
What does SPL stand for?

Standard PHP Library
Source PHP Library
Standard PHP List
Source PHP List
How many predefined exceptions does SPL provide access to?

13
14
15
16
Which of the following is/are not an exception? i) BadFunctionCallException ii) BadMethodCallException iii) LogicException iv) DomainException

All of the mentioned
Only iv)
iii) and iv)
None of the mentioned
Which of the following is/are an exception? i) OutOfBoundException ii) OutOfRangeException iii) OverflowException iv) UnderflowException

All of the mentioned
i) and iii)
i) and ii)
None of the mentioned