13

Does error_reporting(0); have any effect on error logging (to file), or does it just suppress on-screen error display?

Thanks.

2
  • This is crazy - four conflicting answers? Commented Dec 16, 2009 at 2:47
  • I know, I've tried the documentation and search engines but conflicting statements there as well. Thanks for all input, I'm going with zombat's answer for further testing. Commented Dec 16, 2009 at 2:54

3 Answers 3

14

Yes, it affects both.

The error_reporting level defines what levels of errors gets triggered. Whether you log or display those errors are determined by the other settings.

To summarize:

In essence, setting error_reporting(0) means that you've turned off error reporting, and nothing will be logged to file or output to the screen.

Sign up to request clarification or add additional context in comments.

Comments

0

It just suppresses displayed errors. Your ini settings for error logging determine logging levels.

Comments

-4

PHP has pretty good docs, check out

http://us.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting for what it does,

http://us.php.net/manual/en/function.error-reporting.php for the runtime function

Its effects depend on where stderr is going.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.