On Thu, 2007-08-16 at 17:39 -0600, Richard K Miller wrote: > Here's an OOP question that perplexes me. It seems PHP doesn't treat > static variables correctly in child classes > .... > WHAT I EXPECTED: > Regular variable in ABC > Static variable in ABC > Regular variable in DEF > Static variable in DEF > > ACTUAL OUTPUT: > Regular variable in ABC > Static variable in ABC > Regular variable in DEF > Static variable in ABC <--- This is different from what I expected > > Anyone know why?
Actually a better terminology to describe these variables is "class variables" vs. "instance variables". A static variable is bound to the class definition itself, while a non-static variable gets a new instance of the variable with each "new" instance of the class. -- Walt _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
