All pastes #673761 Raw Edit

Miscellany

public php v1 · immutable
#673761 ·published 2007-08-28 17:29 UTC
rendered paste body
<?	function debug_handler($errno, $errstr, $errfile, $errline)	{		var_dump('Err ' . $errno . ': ' . $errstr . ' on ' . $errline . ' of ' . $errfile);		$backtrace = debug_backtrace();				var_dump('backtrace');				unset($backtrace[0]);				if (sizeof($backtrace) > 0)		{			print <<<DEBUGTBL			<script type="text/javascript">				function s(id)				{					document.getElementById(id).style.visibility = 'visible';					document.getElementById(id).style.display = 'block';				}			</script>			<table width="100%">				<tr>					<td>Class</td>					<td>Type</td>					<td>Function</td>					<td>Line</td>					<td>File</td>					<td>Params</td>				</tr>DEBUGTBL;			foreach($backtrace as $key => $call)			{				print <<<DEBUGTBL					<tr>						<td>{$call['class']}</td>						<td>{$call['type']}</td>						<td>{$call['function']}</td>						<td>{$call['line']}</td>						<td>{$call['file']}</td>						<td><a href="javascript:s('err_{$key}');">View</a></td>					</tr>					<tr id="err_{$key}" style="display: none; visibility: hidden">						<td colspan="6">DEBUGTBL;								var_dump($call['args']);								print <<<DEBUGTBL						</td>					</tr>DEBUGTBL;			}						print <<<DEBUGTBL			</table>DEBUGTBL;		}		exit;	}	?>