Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line?
Correct answer
A. ignore_repeated_errors
16 views
A. ignore_repeated_errors
16 views
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.
Not sure why the answer is A? Ask here and get an explanation.