- set_exception_handler: documentation ( source)
<?php
function handler($e){
echo $e->getMessage();
}
class AcessDeniedException extends Exception{
public function __construct(){
parent::__construct();
echo 'This is my exception';
}
}
set_exception_handler (handler);
if(false){
throw new AcessDeniedException('Access DENIED!!!!!' , 1);
}