Web Designing MCQs

Top 20 MCQ Questions on Error Handling in PHP

Pinterest LinkedIn Tumblr
This set of top 20 MCQ questions on error handling in PHP includes the collections of multiple-choice questions on the fundamentals of error handling method in PHP. It includes MCQ questions on the different error levels available in PHP, PHP configuration directives, and PHP’s error logging functions and their parameters.

Read Also: Top 20 MCQ Questions on Namespaces in PHP

1) There are … separate error levels are available in PHP.
A. Fifteen
B. Sixteen
C. Seventeen
D. Eighteen

2) The … error level was introduced in …
A. PHP 5.2
B. PHP 5.3
C. PHP 5.4
D. PHP 6

3) In PHP’s error reporting, the … level reports fatal run-time errors.
A. E_ERROR
B. E_RUN_ERROR
C. E_NOTICE
D. R_ERROR

4) In PHP’s error reporting, the … level reports compile-time parse errors.
A. E_ERROR
B. E_PARSE_ERROR
C. E_COMPILE_PARSE
D. E_PARSE

5) In the … level, warnings regarding user-initiated use of features scheduled for removal in future PHP release.
A. E_DEPRECATED
B. E_USER_DEPRECATED
C. E_USER_ERROR
D. E_USER_REMOVAL

6) The error level … suggest code changes based on the developer’s determinations as to proper coding methodologies and is intended to ensure portability across PHP versions.
A. E_STRICT
B. E_WARNING
C. E_USER_WARNING
D. E_SUGGESTS

7) In PHP error handling, the … directives determine the reporting sensitivity level.
A. display_errors
B. error_reporting
C. error_log
D. display_startup_errors

8) Enabling the … directive results in the display of any errors meeting the criteria defined by error_reporing.
A. display_errors
B. log_error
C. error_log
D. display_startup_errors

9) The … directive will display any error encountered during the initialization of the PHP engine.
A. display_errors
B. error_reporting
C. error_log
D. display_startup_errors

10) Errors can be sent to the system logging daemon or can be sent to a file specified by the administrator via the … directives.
A. display_errors
B. error_reporting
C. error_log
D. display_startup_errors

11) Enabling … causes PHP to disregard repeated error messages that occur within the same file on the same line.
A. ignore_repeated_errors
B. ignore_repeated_source
C. repeated_error_messages
D. ignore_repeated_error_messages

12) Enabling … causes PHP to disregarded repeated error messages emanating from different files or different lines within the same file.
A. ignore_repeated_errors
B. ignore_repeated_source
C. repeated_error_messages
D. ignore_repeated_error_messages

13) While opening the logging connection, the … option immediately opens the connection to the Syslog.
A. LOG_CONS
B. LOG_DELAY
C. LOG_NDELAY
D. LOG_ODELAY

14) While opening the logging connection, the … option does not open the connection until the first message has been submitted for logging.
A. LOG_CONS
B. LOG_DELAY
C. LOG_NDELAY
D. LOG_ODELAY

15) … is the parameter of Syslog() function which specifies a serious system problem, likely signaling a crash.
A. LOG_EMERG
B. LOG_CRIT
C. LOG_ERR
D. LOG_WARNING

16) … is the parameter of Syslog() function which specifies a critical error that could render a service unusable but does not necessarily place the system in danger.
A. LOG_EMERG
B. LOG_CRIT
C. LOG_ERR
D. LOG_WARNING

17) State whether the following statements about PHP’s logging facility are TRUE or FALSE.
i. PHP’s logging facilities will automatically be initialized when the openlog() or Syslog() functions are called.
ii. Calling the openlog() function is necessary.
iii.The Syslog() function is responsible for sending a custom message to the system log.
A. i-True, ii-True, iii-False
B. i-True, ii-False, iii-False
C. i-True, ii-False, iii-True
D. i-True, ii-True, iii-True

18) The error level … indicate that the script encountered something that could indicate an error.
A. E_ERROR
B. E_RUN_ERROR
C. E_NOTICE
D. R_ERROR

19) Enabling … causes PHP to store the most recent error message in the variable $php_errormsg.
A. display_errors
B. track_errors
C. track_recent_errors
D. display_track_errors

20) In the openlog() function, the logging option … will output the logged message to both the Syslog and standard error.
A. LOG_PERROR
B. LOG_PID
C. LOG_CONS
D. LOG_DELAY

Answers

  1. B. Sixteen
  2. C. PHP 5.4
  3. A. E_ERROR
  4. D. E_PARSE
  5. B. E_USER_DEPRECATED
  6. A. E_STRICT
  7. B. error_reporting
  8. A. display_errors
  9. D. display_startup_errors
  10. C. error_log
  11. A. ignore_repeated_errors
  12. B. ignore_repeated_source
  13. C. LOG_NDELAY
  14. D. LOG_ODELAY
  15. A. LOG_EMERG
  16. B. LOG_CRIT
  17. C. i-True, ii-False, iii-True
  18. C. E_NOTICE
  19. B. track_errors
  20. A. LOG_PERROR

Read Next: Top 20 MCQ Questions on Exception Handling in PHP

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.