Is it good practice to use custom error levels on trigger_error()?
For example, can I do:
define('E_MY_LEVEL', 3);
...
trigger_error('Hey this error occurs every time!', E_MY_LEVEL);
? Consider that 3 is not a PHP Error level value so it doesn’t go in conflict with the other levels.
(I want to do this so that I don’t have to create another function that requires other code rather than the one I’ve already written in the error_handler function I associated to set_error_handler().)
Hard to say whether this is good practice or not, but 3 does exist as a PHP Error Level Value –
Also not knowing what your trigger() function is, trigger_error needs an error level in the E_USER range… maybe it would be best to use E_USER_NOTICE? (1024)