in reply to Re: variables as classes
in thread variables as classes

I already do that for user submitted data.

I need this functionality for data that is coming out of my database, that I perform various markup or logic operations on. If I pull an email address out of the DB, all of my various functions still check it to verfiy that it is an email when they're passed it.

I don't want to accidentally send an email to a non-email, or turn a non-http address into an href. Those functions need to catch errors, and every function I write checks the input data.

With some custom classes, I can just check the ISA before running a regex. thats way more efficient than running a regex over and over again. And if I'm not using a class, but a string, then I just run the regex.