Answer the question
In order to leave comments, you need to log in
Why are errors displayed when error_reporting is disabled?
Hello colleagues! I recently encountered the following problem:
I turn off error reporting in the current script using the following script:
<?php
$oldLevel = error_reporting(0);
echo RD w3r4 d Brf=s bkporswk "" "da "
<br>>>
?>
Parse error: syntax error, unexpected 'w3r4' (T_STRING), expecting ',' or ';' in C:\OpenServer\domains\tests\tests.php on line 4
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Because error_reporting(0) turns off error logging. And the value "0" is not correct. Defaults to NULL or takes a constant (several constants.)
And display_errors() disables displaying errors in the browser.
display_errors string
This setting determines whether errors should be displayed with the rest of the output, or whether errors should be hidden from the user.
You can turn off error output like this
Even though display_errors can be set at run time (with the ini_set() function), this has no effect if there are fatal errors in the script. This is due to the fact that the expected actions of the program during execution will not receive control (will not be executed).
Read more here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question