Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ErrHandl {
- public function __construct() {
- $this->registerHandler();
- }
- public function registerHandler() {
- set_error_handler([$this, 'errorHandler']);
- }
- public function errorHandler() {
- $this->registerHandler();
- echo 'oh no, an error!';
- }
- }
- //------
- $errHandl = new ErrHandl();
- trigger_error('test');
- echo 'still alive!';
- trigger_error('test2');
- echo 'works, thanks to re-registering...';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement