PHP Exception Handling
- Which one of the following is the right description for the method getMessage() ?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Returns the message if it is passed to the constructor
- Which of the following statements invoke the exception class?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
throw new Exception();
- Which version added the method getPrevious()?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
PHP 5.3
- How many methods are available for the exception class?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The seven methods are: getCode(), getFile(), getLine(), getMessage(), getPrevious(), getTrace(), getTraceAsString().
- Which version of PHP was added with Exception handling?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Exception handling was added to PHP with the version 5 release, and further enhanced with version 5.3.