Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasWiesner committed Feb 15, 2012
1 parent c25cd46 commit ed12507
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions error.php
@@ -1,30 +1,11 @@
<?php
$html = '
<html>
<head></head>
<body>
<h1>Error</h1>
<pre style="disply:block;background-color:silver;border:1px groove;padding:5px;">
%s
</pre>
</body>
</html>';

function myErrorHandler($errno, $errstr, $errfile, $errline) {
global $html;
if ($errno) {
echo sprintf($html, print_r(array($errno, $errstr, $errfile, $errline), true));
die();
}
print_r(array($errno, $errstr, $errfile, $errline));
}
set_error_handler("myErrorHandler");

function shutDownFunction() {
global $html;
$error = error_get_last();
if ($error) {
echo sprintf($html, print_r($error, true));
die();
}
print_r(error_get_last());
}
register_shutdown_function('shutdownFunction');

0 comments on commit ed12507

Please sign in to comment.