How can you enable error reporting in PHP?

How can you enable error reporting in PHP?

Team Leader Asked on February 11, 2017 in PHP.
Add Comment
1 Answer(s)

The error_reporting() function sets the error_reporting directive at runtime.

 

<?php
 // Turn off error reporting
 error_reporting(0);
// Report all errors
 error_reporting(E_ALL);
// Report runtime errors
 error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all PHP errors
 error_reporting(-1);
// Report all errors except E_NOTICE
 error_reporting(E_ALL & ~E_NOTICE);
 ?>
 

 

Team Leader Answered on March 19, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.