Sail E0 Webinar

MCQs

Total Questions : 19 | Page 2 of 2 pages
Question 11. How many methods are available for the exception class?
  1.    5
  2.    6
  3.    7
  4.    8
 Discuss Question
Answer: Option C. -> 7


The seven methods are: getCode(), getFile(), getLine(), getMessage(), getPrevious(), getTrace(), getTraceAsString().


Question 12. Which version added the method getPrevious()?
  1.    PHP 4
  2.    PHP 5
  3.    PHP 5.1
  4.    PHP 5.3
 Discuss Question
Answer: Option D. -> PHP 5.3


PHP 5.3


Question 13. You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as..
  1.    protected
  2.    final
  3.    static
  4.    private
 Discuss Question
Answer: Option B. -> final


Marking a method as final prevents it from being overridden by a subclass.


Question 14. Which of the following statements invoke the exception class?
  1.    throws new Exception();
  2.    throw new Exception();
  3.    new Exception();
  4.    new throws Exception();
 Discuss Question
Answer: Option B. -> throw new Exception();


throw new Exception();


Question 15. Which one of the following is the right description for the method getMessage() ?
  1.    Returns the message if it is passed to the constructor.
  2.    Returns the message if it is passed to the class.
  3.    Returns the message if it is passed to the file.
  4.    Returns the message if it is passed to the object.
 Discuss Question
Answer: Option A. -> Returns the message if it is passed to the constructor.


Returns the message if it is passed to the constructor.


Question 16. Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line?
  1.    ignore_repeated_errors
  2.    ignore_repeat_error
  3.    repeatedly_ignore_error
  4.    repeated_error_ignore
 Discuss Question
Answer: Option A. -> ignore_repeated_errors


ignore_repeated_errors


Question 17. Which logging option's description is, if an error occurs when writing to the syslog, send output to the system console?
  1.    LOG_CONS
  2.    LOG_NDELAY
  3.    LOG_ODELAY
  4.    LOG_PERROR
 Discuss Question
Answer: Option A. -> LOG_CONS


LOG_CONS


Question 18. Which function is responsible for sending a custom message to the system log?
  1.    systemlog()
  2.    syslog()
  3.    log_system()
  4.    sys_log()
 Discuss Question
Answer: Option B. -> syslog()


syslog()


Question 19. Which function initializes the constants necessary for using the openlog(), clodelog(), and syslog() functions?
  1.    define_variable()
  2.    define_log_variable()
  3.    log_variable()
  4.    define_syslog_variable()
 Discuss Question
Answer: Option D. -> define_syslog_variable()


If you're running PHP version 5.2.X or older, you need to execute this function before using any of the following logging functions.


Latest Videos

Latest Test Papers