1. Home
  2. Computer Science MCQs
  3. PHP
  4. Say you want to report error concerned about fatal…

Added 19 Jan 2024

Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use?

  1. error_reporting = E_ALL
  2. error_reporting = E_ERROR | E_PARSE | E_CORE_ERROR
  3. error_reporting = E_ERROR | E_COMPILE_WARNING | E_CORE_ERROR
  4. error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR Correct answer

Correct answer

D. error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR

13 views

MCQSEXAM

Explanation

The correct setting is error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR. Each constant is a bit flag: E_ERROR covers fatal run-time errors, E_COMPILE_ERROR covers fatal compile-time errors and E_CORE_ERROR covers fatal errors raised while PHP itself starts up. The bitwise OR operator (|) combines them into one reporting level.

The other options either report everything (E_ALL) or mix in parse errors and warnings that the question did not ask for.

For more solved questions like this one, see Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs