Voting

: max(zero, four)?
(Example: nine)

The Note You're Voting On

teynon1 at gmail dot com
13 years ago
It might be a good idea to include E_COMPILE_ERROR in error_reporting.

If you have a customer error handler that does not output warnings, you may get a white screen of death if a "require" fails.

Example:
<?php
error_reporting
(E_ERROR | E_WARNING | E_PARSE);

function
myErrorHandler($errno, $errstr, $errfile, $errline) {
// Do something other than output message.
return true;
}

$old_error_handler = set_error_handler("myErrorHandler");

require
"this file does not exist";
?>

To prevent this, simply include E_COMPILE_ERROR in the error_reporting.

<?php
error_reporting
(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
?>

<< Back to user notes page

To Top