Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use?
Correct answer
D. error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR
13 views
D. error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR
13 views
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.
Not sure why the answer is D? Ask here and get an explanation.