Posted by Chung Leong on 09/16/05 17:41
www.douglassdavis.com wrote:
> Let's say an invalid string is passed to construct it. What is the
> appropriate way to handle this? I know in Java I would probably throw
> an exception, but I don't know how much people really use exceptions in
> PHP right now. So, I don't want to depend on it.
That sounds like a programmer's error to me. The appropriate way to
handle this to be to let the programmer know that he/she made a
mistake. I would use trigger_error() or simply die().
Call me old school. In my opinion things that are within a programmer's
control are not exceptions.
[Back to original message]
|