Skip to content

Instantly share code, notes, and snippets.

@MarioBlazek
Created April 16, 2019 08:37
Show Gist options
  • Save MarioBlazek/594cf85d3d785d8c3c5be2de1e8c98f7 to your computer and use it in GitHub Desktop.
Save MarioBlazek/594cf85d3d785d8c3c5be2de1e8c98f7 to your computer and use it in GitHub Desktop.
<?php
function myCustomErrorHandler(int $errNo, string $errMsg, string $file, int $line) {
echo "Wow my custom error handler got #[$errNo] occurred in [$file] at line [$line]: [$errMsg]";
}
set_error_handler('myCustomErrorHandler');
try {
what;
} catch (Throwable $e) {
echo 'And my error is: ' . $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment