Yeah, it's supposed to be this way. We copied C++.


At 10:50 AM 3/9/2001 -0600, Andrei Zmievski wrote:
>Just ran into something (well, actually searching for it) and wanted to
>know what everyone's thoughts on this were and whether it should stay
>that way.
>class Foo {
>     function get()
>     {
>         static $i = 0;
>         return ++$i;
>     }
>$c1 = new Foo;
>$c2 = new Foo;
>Basically, the static variable keeps its value even between different
>class instances. In my case, it actually helps me with something, but on
>the other hand, it doesn't seem that it should be this way..
>* I don't have a solution but I admire the problem. *

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to