Brad Pauly wrote:
should basic data validation come before a function call or be performed within the function?
I would do the validation inside the function. This avoids repeating the validation everywhere the function is called. It also makes the function more self-contained. It expects a certain input and complains, or returns false, if it doesn't get it.
yes, and of course shouldnt every function check it parametres before proceeding?
-- Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com www.sf.net/projects/phpdatetime www.sf.net/projects/phptimesheet
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php