Re: [PHP] Re: Strange behaviour of static declared content.

2007-10-19 Thread Stut
Colin Guthrie wrote: PS I know the above examples are contrived and that constructors would be more appropriate for the above - but using constructors is not always possible due to how you deal with failed initialisations where exceptions are not desirable. I see what you mean. You thought that

Re: [PHP] Re: Strange behaviour of static declared content.

2007-10-19 Thread Stut
Colin Guthrie wrote: Stut wrote: Colin Guthrie wrote: Stut wrote: Stut wrote: In that case you need a new foo. That's the only way you're going to reset the internal static if the API doesn't give you a way to do it. $f=new foo(); $f->bar(); $f->bar(); $g=new foo(); $g->bar(); Actually, scr

Re: [PHP] Re: Strange behaviour of static declared content.

2007-10-19 Thread Stut
Colin Guthrie wrote: Stut wrote: Stut wrote: In that case you need a new foo. That's the only way you're going to reset the internal static if the API doesn't give you a way to do it. $f=new foo(); $f->bar(); $f->bar(); $g=new foo(); $g->bar(); Actually, scratch that, won't work. Not even uns

Re: [PHP] Re: Strange behaviour of static declared content.

2007-10-18 Thread Nathan Nobbe
On 10/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote: > > Stut wrote: > > Stut wrote: > >> In that case you need a new foo. That's the only way you're going to > >> reset the internal static if the API doesn't give you a way to do it. > >> > >> $f=new foo(); > >> $f->bar(); > >> $f->bar(); > >> $g=