Req #26213 [Opn->Csd]: trigger_error with multi-level error

From: Date: Tue, 24 Oct 2017 01:43:19 +0000
Subject: Req #26213 [Opn->Csd]: trigger_error with multi-level error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211870@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=26213&edit=1 ID: 26213 Updated by: kalle@php.net Reported by: php at bouchery dot com Summary: trigger_error with multi-level error -Status: Open +Status: Closed Type: Feature/Change Request Package: *General Issues Operating System: * PHP Version: I* -Assigned To: +Assigned To: kalle Block user comment: N Private report: N New Comment: I don't think this is something we will ever do, the best bet here is to have more extensions output Exceptions. PHP7 moves greatly in that direction with the Engine based exceptions. This should be an RFC if anything, you can read more about RFC processes at the wiki: http://wiki.php.net/ Previous Comments: ------------------------------------------------------------------------ [2012-07-16 15:36:25] notdefix at hotmail dot com Duplicate for: #47887 ? ------------------------------------------------------------------------ [2003-11-12 06:45:41] php at bouchery dot com Description: ------------ I would like to use trigger_error with an error level like this : DB_FATAL_ERROR = E_USER_ERROR XML_FATAL_ERROR = E_USER_ERROR + 1 SOMTHING_FATAL_ERROR = E_USER_ERROR + 2 ..etc. In my error_handler, I'll use these error level to change its behaviour. It could be a great improvement for error managing to define our user error levels. Reproduce code: --------------- <?php trigger_error( 'My error' , E_USER_ERROR + 1 ); ?> Expected result: ---------------- in error_handler, $errno is equal to "E_USER_ERROR + 1" Actual result: -------------- "Warning: Invalid error type specified" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=26213&edit=1

« previous php.bugs (#211870) next »