<?php
	$errFilterMask = (E_STRICT | E_NOTICE | E_WARNING);
	function _err_handler($errno, $errtext) {
		global $errFilterMask;
		if ($errno & $errFilterMask)
			return;
		$backtrace = debug_backtrace();
?>
<h1>Application Error</h1>
<p>
	An error was encountered in the application: <?= $errtext ?>
</p>
<table>
	<tr>
		<th>Location</th>
		<th>Function</th>
	</tr>
<?php
		foreach($backtrace as $btindex => $btinfo) {
?>
	<tr>
		<td><?= $btinfo['file'] ?>:<?= $btinfo['line'] ?></td>
		<td><?= $btinfo['function'].($btinfo['function'] ? ' ('.join(",", $btinfo['args']).')' : '') ?></td>
	</tr>
<?php
		}
?>
</table>
<?php
		die();
	}

	//set_error_handler(_err_handler);
?>
