Bird
0
0

Which statement about set_error_handler is TRUE?

hard📝 Conceptual Q10 of 15
PHP - Error and Exception Handling
Which statement about set_error_handler is TRUE?
AIt can handle fatal errors like parse errors.
BIt automatically logs errors to the system log.
CIt replaces the default error handler for all error types except fatal errors.
DIt disables error reporting globally.
Step-by-Step Solution
Solution:
  1. Step 1: Understand limitations of set_error_handler

    It cannot handle fatal errors like parse errors but handles warnings, notices, and user errors.
  2. Step 2: Evaluate each statement

    Only It replaces the default error handler for all error types except fatal errors. correctly states it replaces default handler except for fatal errors.
  3. Final Answer:

    It replaces the default error handler for all error types except fatal errors. -> Option C
  4. Quick Check:

    set_error_handler excludes fatal errors [OK]
Quick Trick: set_error_handler cannot catch fatal parse errors [OK]
Common Mistakes:
  • Thinking it handles fatal errors
  • Assuming it logs errors automatically
  • Believing it disables error reporting

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes