note 34236 deleted from function.set-error-handler by sniper
| From: | sniper@php.net | Date: | Fri, 03 Oct 2003 05:38:14 +0000 |
| Subject: | note 34236 deleted from function.set-error-handler by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57655@lists.php.net to get a copy of this message | ||
Note Submitter: bishop
----
"It only works with the E_USER family of constants."
Say you have this code:
set_error_handler('myhandler');
function myhandler($msg, $sev) {
echo "($sev) $msg<br />";
}
trigger_error('doh!', E_ERROR);
You will NOT get "(1) doh!" You will get "(2) Invalid error type specified".
In other words, PHP takes it upon itself to tell you the constant isn't one it expects and
DISCARDS your error message.