Re: [PHP-DEV] Bug #331: static variables in object methods broken From: Rasmus Lerdorf (rasmus <email protected>)
Date: 04/29/98

> Good call. I can fix static so it would work inside objects, but I think
> it's generally a bad idea, as the same static variable would be shared
> among all objects of that type. You should really use some property
> instead, e.g. $this->a.
>
> I think the best thing would be generating a warning in case static is
> declared inside member functions, but I can also make it work like in
> regular functions. What do you guys think?

I think if we document the fact that the static is shared among that class
of objects, it is better than simply disallowing it. Who knows, maybe
this is useful to someone.

-Rasmus