Skip to content

Instantly share code, notes, and snippets.

@cyberhobo
Created December 10, 2013 20:26
Show Gist options
  • Save cyberhobo/7897674 to your computer and use it in GitHub Desktop.
Save cyberhobo/7897674 to your computer and use it in GitHub Desktop.
PHP (5.3 and up) Notice & Warning Backtrace - just need to quickly see what's causing that message in a non-production environment? Override error handling. In WordPress I do this in my wp-config.php, and remove it again when done.
set_error_handler( function( $no, $str, $file, $line ) {
echo "<pre>$str\n";
var_dump( debug_backtrace() );
echo "</pre>";
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment