trigger_error from libraries in PHP 4
Posted: Wed Feb 07, 2007 10:28 am
Hi. For those of us still supporting PHP 4, I wonder if you think it is OK to use trigger_error from library code?
For the most part I've usually returned simple error classes from library classes/functions. I've actually never really liked the trigger_error way of doing things in PHP but lately I've been using it more. But I wonder if it's a bad thing to do this from library code because it takes control out of the hands of the user of the library.
And if it is ok to use trigger_error from libraries what levels are OK to use? Would you want to trigger an E_USER_ERROR (fatal) from a library? I would think not but maybe you can give me a reason why it's OK.
Hope to hear your thoughts.
For the most part I've usually returned simple error classes from library classes/functions. I've actually never really liked the trigger_error way of doing things in PHP but lately I've been using it more. But I wonder if it's a bad thing to do this from library code because it takes control out of the hands of the user of the library.
And if it is ok to use trigger_error from libraries what levels are OK to use? Would you want to trigger an E_USER_ERROR (fatal) from a library? I would think not but maybe you can give me a reason why it's OK.
Hope to hear your thoughts.