Rabu, 22 Juli 2015

PHP : Error Reporting Management For Debugging

In PHP we can choose the level of error reports to be displayed or to be hidden. Is that Notice, Warning, Parse, Deprecated, Fatal Error, or we will hide all the error reporting level. We will use the PHP error_reporting function.

Here are some examples of how to use it.
<?php
// Turn off all error reporting level
error_reporting(0);

// Report runtime errors only
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Report all errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);

// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
?>
Share it Please

0 komentar:

Posting Komentar

Copyright @ 2013 Web Attribute. Designed by Templateism | Love for The Globe Press