Home / CSE / PHP - CS :: Exceptions and Error Handling

CSE :: PHP - CS

  1. Which version of PHP was added with Exception handling?

  2. A.

     PHP 4

    B.

     PHP 5

    C.

     PHP 5.3

    D.

     PHP 6


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

  4. A.

     5

    B.

     6

    C.

     7

    D.

     8


  5. Which version added the method getPrevious()?

  6. A.

     PHP 4

    B.

     PHP 5

    C.

     PHP 5.1

    D.

     PHP 5.3


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

  8. A.

     throws new Exception();

    B.

     throw new Exception();

    C.

     new Exception();

    D.

     new throws Exception();


  9. Which one of the following is the right description for the method getMessage() ?

  10. A.

     Returns the message if it is passed to the constructor

    B.

     Returns the message if it is passed to the class

    C.

     Returns the message if it is passed to the file

    D.

     Returns the message if it is passed to the object


  11. You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as__________

  12. A.

     protected

    B.

     final

    C.

     static

    D.

     private


  13. What does SPL stand for?

  14. A.

     Standard PHP Library

    B.

     Source PHP Library

    C.

     Standard PHP List

    D.

     Source PHP List


  15. How many predefined exceptions does SPL provide access to?

  16. A.

     13

    B.

     14

    C.

     15

    D.

     16


  17. Which of the following is/are not an exception?
    1. BadFunctionCallException
    2. BadMethodCallException
    3. LogicException
    4. DomainException

  18. A.

     All of the mentioned

    B.

     Only 4

    C.

     3 and 4

    D.

     None of the mentioned


  19. Which of the following is/are an exception?
    1. OutOfBoundException
    2. OutOfRangeException
    3. OverflowException
    4. UnderflowException

  20. A.

     All of the mentioned

    B.

     1 and 3

    C.

     1 and 2

    D.

     None of the mentioned