PHP Error and Exception Handling Mcqs
Our collections of Multiple choice questions and answers focuses on study of PHP Error and Exception Handling. These questions are chosen from a collection of most authoritative and best reference books on PHP Language. Our aim is to prepare an individual for competitive exams like NTS, GAT, ECAT, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate PHP Error and Exception Handling Topic comprehensively.
PHP Programming Mcqs
- Basics of PHP Mcqs
- PHP Arrays and Functions Mcqs
- PHP Constants and Operators Mcqs
- PHP Controls Structures Mcqs
- PHP Error and Exception Handling Mcqs
- PHP Filesystem Mcqs
- PHP Functions Mcqs
- PHP Objects Tools and Variables Mcqs
- PHP OOP Mcqs
- PHP Session Handling Mcqs
- Strings and Regular Expressions Mcqs
Computer MCQS
Sciences MCQS
2.
What is the description of Error level E_ERROR?
Fatal run-time error
Near-fatal error
Compile-time error
Fatal Compile-time error
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
3.
Which version of PHP introduced E_STRICT Error level?
PHP 4
PHP 5
PHP 5.2
PHP 5.3
4.
Which character do the error_reporting directive use to represent the logical operator NOT?
/
!
~
^
5.
Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use?
Error_reporting = E_ALL
Error_reporting = E_ERROR | E_PARSE | E_CORE_ERROR
Error_reporting = E_ERROR | E_COMPILE_WARNING | E_CORE_ERROR
Error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
6.
Which version introduced the function error_get_last()?
PHP 4
PHP 5
PHP 5.2
PHP 5.3
7.
Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line?
Ignore_repeated_errors
Ignore_repeat_error
Repeatedly_ignore_error
Repeated_error_ignore
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
8.
Which function initializes the constants necessary for using the openlog(), clodelog(), and syslog() functions?
Define_variable()
Define_log_variable()
Log_variable()
Define_syslog_variable()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
10.
Which function is responsible for sending a custom message to the system log?
Systemlog()
Syslog()
Log_system()
Sys_log()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
11.
Which version of PHP was added with Exception handling?
PHP 4
PHP 5
PHP 5.3
PHP 6
12.
How many methods are available for the exception class?
5
6
7
8
13.
Which version added the method getPrevious()?
PHP 4
PHP 5
PHP 5.1
PHP 5.3
14.
Which of the following statements invoke the exception class?
Throws new Exception();
Throw new Exception();
New Exception();
New throws Exception();
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
15.
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
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
16.
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