Sorry to jump in the middle of a conversation, but I just wanted to
say that I personally use trigger_error() quite often.
Me too, I use it for warnings, notices, and errors
that cannot be remedied.
In my programs I also simulate custom error codes. The first
part of the error string looks something like
"[error.code] Message"
and I parse this later and act upon it.
The site I
maintain has a nice custom error handler which logs the error and
emails the admins the error details + var dumps, etc.
Absolutely.
I often use
trigger_error() in my code because it allows me to treat certain
situations the same as a PHP generated error. Of course, I suppose I
could just call my custom error handler directly but that seems less
elegant...just MHO.
The way with trigger_errors is better because you can at any
time turn the custom error handler off, and everything would
still work.
Bye,
Ivan