Oh yeah, good point. Hmmm, tricky. It would be very beneficial to find another way to change the messages class wide though, especially for people who need non English messages. I guess the only way to do it is to extend the validator and then override the property?

Bill Karwin wrote:
One of the issues with using static class variables is how they are
handled in subclasses.

class foo
{
        protected static $_string = 'foo';

        public function printString()
        {
                echo self::$_string;
        }
}
class subfoo extends foo
{
        protected static $_string = 'subfoo';
}

$subfoo = new subfoo();
$subfoo->printString();  // prints 'foo'

The implication is that when working with subclasses, if you override a
static property, you have to override all code that references that
static property, even if your code is identical to the code in the
parent class.  This makes static properties painful to work with, so I
avoid them wherever possible.

Regards,
Bill Karwin


--
Jack

Reply via email to