Skip to content

Instantly share code, notes, and snippets.

@arturom
Created June 28, 2016 17:50
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 arturom/d7664686cc61c9f8359299cb5b44f76c to your computer and use it in GitHub Desktop.
Save arturom/d7664686cc61c9f8359299cb5b44f76c to your computer and use it in GitHub Desktop.
<?php
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
static $calls = 0;
echo PHP_EOL, PHP_EOL, $errno, ' ', $errstr, ' ', $errfile, ' ', $errline, PHP_EOL;
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
print_r($bt);
// debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
if($calls ++ > 3) {
exit(1);
}
}, E_ALL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment