Skip to content

Instantly share code, notes, and snippets.

@zguillez
Created March 1, 2023 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zguillez/3b7246e17911bf8328667518fbd4d326 to your computer and use it in GitHub Desktop.
Save zguillez/3b7246e17911bf8328667518fbd4d326 to your computer and use it in GitHub Desktop.
Display errors and warnings in PHP
/**
* require_once __DIR__ . '/inc/debug.php';
* $debugger = new Debug(true);
*/
class Debug
{
public function __construct($debug)
{
if ($debug) {
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
}
date_default_timezone_set('Europe/Madrid');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment