Skip to content

Instantly share code, notes, and snippets.

@funivan
Last active December 27, 2015 10:59
Show Gist options
  • Select an option

  • Save funivan/7315357 to your computer and use it in GitHub Desktop.

Select an option

Save funivan/7315357 to your computer and use it in GitHub Desktop.
errors
<?
set_error_handler('exceptions_error_handler');
function exceptions_error_handler($severity, $message, $filename, $lineno) {
if (error_reporting() == 0) {
return;
}
if (error_reporting() & $severity) {
throw new ErrorException($message, 0, $severity, $filename, $lineno);
}
}
$a[1] = 'jfksjfks';
try {
$b = $a[0];
} catch (Exception $e) {
echo "jsdlkjflsjfkjl";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment