1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which of the following statements causes PHP to disregard…

Added 19 Jan 2024

Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line?

  1. ignore_repeated_errors Correct answer
  2. ignore_repeat_error
  3. repeatedly_ignore_error
  4. repeated_error_ignore

Correct answer

A. ignore_repeated_errors

16 views

MCQSEXAM

Explanation

In PHP, the error_reporting() function can be used to modify the error reporting level, and the @ symbol can be used to suppress error messages. However, to specifically disregard repeated error messages that occur within the same file and on the same line, you can use the ini_set() function to set the ignore_repeated_errors directive to true.

ini_set('ignore_repeated_errors', true);

This setting instructs PHP to ignore repeated error messages that happen within the same file and on the same line. It can be useful to reduce noise in error logs when the same error is triggered multiple times in a script.

Doubts & discussion

Not sure why the answer is A? 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