What are some reasons why PHP would force errors to show, no matter what you tell it to disable?
I have tried
error_reporting(0); ini_set('display_errors', 0);
with no luck.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note the caveat in the manual at http://uk.php.net/error_reporting:
If your underlying system is configured to report E_STRICT errors, these may be output before your code is even considered. Don’t forget, error_reporting/ini_set are runtime evaluations, and anything performed in a ‘before-run’ phase will not see their effects.
Based on your comment that your error is…
Then the same general concept applies. Your code is never run, as it is syntactically invalid (you forgot a ‘;’). Therefore, your change of error reporting is never encountered.
Fixing this requires a change of the system level error reporting. For example, on Apache you may be able to place…
php_value error_reporting 0
in a .htaccess file to suppress them all, but this is system configuration dependent.
Pragmatically, don’t write files with syntax errors 🙂