Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exception_error_handler($errno, $errstir, $errfile, $errline ) {
- throw new ErrorException($errstr, $errno, 0, $errfile, $errline);;
- }
- set_error_handler("exception_error_handler");
- /* Trigger exception */
- strpos();
- function exception_error_handler($errno, $errstir, $errfile, $errline ) {
- throw new ErrorException($errstr, $errno, 0, $errfile, $errline);;
- }
- set_error_handler("exception_error_handler");
- try {
- /* Trigger exception */
- strpos();
- echo 'No exception was thrown';
- }
- //catch exception
- catch(Exception $e) {
- echo 'Message: ' .$e->getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement