|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-03 19:36 UTC] johannes@php.net
[2012-07-16 14:29 UTC] notdefix at hotmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 21:00:02 2025 UTC |
Description: ------------ It would be useful if trigger_error would accept custom error types. Although I can do this with Exceptions, I can't see a way of sending variable context from where an exception is thrown to the exception handler, and loosing variable context would be a deal breaker. Reproduce code: --------------- define('E_CUSTOM_1', -1); define('E_CUSTOM_2', -2); function error_handler ($errno, $errmsg, $scriptname, $scriptline, $errcontext) { if ($errno == E_CUSTOM_1) die('custom error type'); } set_error_handler('error_handler'); trigger_user('message', E_CUSTOM_1); Expected result: ---------------- custom error type Actual result: -------------- PHP Warning: Invalid error type specified in - on line 7