note 30663 added to function.set-error-handler
| From: | Thomas at rack1 dot php dot net | Date: | Tue, 25 Mar 2003 10:11:52 +0000 |
| Subject: | note 30663 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45786@lists.php.net to get a copy of this message | ||
The best way, I have found to use a class/object as an error handler is to define a class, add your
desired error handling function into the constructor and then call set_error_handler() to the name
of your function, thats it. e.g.
Class Error {
Function Error() {
Function HandleError($n, $m, $f, $l){
print_r(debug_backtrace());
}
set_error_handler('HandleError');
}
}
--
http://www.php.net/manual/en/function.set-error-handler.php
http://master.php.net/manage/user-notes.php?action=edit+30663
http://master.php.net/manage/user-notes.php?action=delete+30663
http://master.php.net/manage/user-notes.php?action=reject+30663