note 30663 deleted from function.set-error-handler by cmb

From: Date: Sun, 25 Aug 2019 08:56:07 +0000
Subject: note 30663 deleted from function.set-error-handler by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211986@lists.php.net to get a copy of this message
Note Submitter: Thomas Staunton ---- 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'); } }

« previous php.notes (#211986) next »