I would actually do the check inside the function, that way you don't have
to do it each time before you call the function. Also, by doing this you
can set things to a default value (if that is relevant to your code...).
At 08:20 PM 2/8/2002 +0100, Nick Wilson wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
> quick Q on writing Methods on PHP:
>If a methods purpose is to take 3 values and do stuff with those values,
>should the error checking (eg. that the values dont='') be done /inside/
>the Method or by the script that calls it?
>It makes more sense to me to have all the error checking and validation
>done /before/ passing it to the method as one of the concepts of classes
>is that their methods are very simple and specific.
>However, I wondered what you all thought on this?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php