There are several levels of error in PHP. By default, PHP outputs occurred errors into stdout (prints them like they're a part of the output content) and writes them into log file.
You can set a minimum level of errors you want to get reported with
error_reporting function. To print all kind of issues you should use:
error_reporting(E_ALL); # Prints all errors, warnings and notices
You can also select which type of issues you want to get reported. They work like flags:
error_reporting(E_ERROR | E_WARNING); # Prints errors and warnings only
To disable all types of issues reporting do this:
Error levels you should learn today:
E_ERROR # Fatal error. PHP script execution will stop on that type of error. E_WARNING # Non-fatal error. Error will be reported but PHP script will continue to execute. E_PARSE # Compile-time (or parsing-level) error. PHP script won't start at all. E_NOTICE # A sort of error that may be not really an error. That's up to the application. E_ALL # All types of issues.
You can also disable output of errors but still continue to log them:
You can suppress a report of a recoverable error in a single statement with
$content = @file_get_contents('so_such_file.txt'); # No report is generated