1. Question: Which statement are true about Exception Handling?

    A
    Definition of error.

    B
    Exceptions are used to change the normal flow of a script if a specified error occurs.

    C
    Exceptions should only be used with error conditions

    Note: Not available
    1. Report
  2. Question: How to get the name of the file throwing the exception?

    A
    getFile()

    B
    getName()

    C
    getCode()

    D
    getMessage()

    Note: Not available
    1. Report
  3. Question: How to get the line number for which the exception is thrown?

    A
    getFile()

    B
    getName()

    C
    getCode()

    D
    getLine()

    Note: Not available
    1. Report
  4. Question: Which of the following statement is the default exception constructor?

    A
    thrown Exception()

    B
    throw new Exception()

    C
    throw new $Exception()

    Note: Not available
    1. Report
  5. Question: During the developing stage, which of the directive used for all errors to be reported?

    A
    error_reporting=All_error & E_strict

    B
    E_All | E_Parse

    C
    error_reporting=E_All  & E_STRICT

    D
    None of the above

    Note: Not available
    1. Report
  6. Question: Which features determine the language’s  error – handling behavior.

    A
    Error Logging

    B
    Exception Handling

    C
    Configuration

    D
    All of the above

    Note: Not available
    1. Report
  7. Question: Which of the following function was introduced in PHP 5.2?

    A
    error_get_last()

    B
    error_get_Last()

    C
    errors_get_Last()

    D
    errors_get_last()

    Note: Not available
    1. Report
  8. Question: Which of the following character is used to represent the logical opretor NOT?

    A
    !

    B
    >=

    C
    <=

    D
    ~

    Note: Not available
    1. Report
  9. Question: Which of the following correct Error Level Description?

    A
    E_USER_ERROR it refers User-generated errors

    B
    E_USER_ERROR it refers User-generated notices

    C
    E_USER_ERROR it refers User-generated warnings

    D
    None

    Note: Not available
    1. Report
  10. Question: What is the output of the following code?
    <?php
    class MyException extends Exception {}
    class AnotherException extends MyException {}
    
    class Foo {
      public function something() {
        throw new AnotherException();
      }
      public function somethingElse() {
        throw new MyException();
      }
    }
    
    $a = new Foo();
    
    try {
      try {
        $a->something();	
      } catch(AnotherException $e) {
        $a->somethingElse();	
      } catch(MyException $e) {
        print "Caught Exception";
      }
    } catch(Exception $e) {
      print "Didn't catch the Exception!";
    }
    
    ?>

    A
    "Caught Exception" followed by "Didn't catch the Exception!"

    B
    A fatal error for an uncaught exception

    C
    "Didn't catch the Exception!"

    D
    "Didn't catch the Exception!" followed by a fatal error

    E
    "Caught Exception"

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd