I might be wrong, but I haven't ever heard statics can't be used in 
regular functions, nor they can only be used in class methods. Although 
such behaviour is not clarified in the documents, references are explained 
enough for me to expect that functionality.

However I agree the name of the test is slightly confusing as I mentioned 
before (this is not directly relevant to the #20175 indeed), and I think 
too that is actually a feature request.

Moriyoshi


"Ilia A." <[EMAIL PROTECTED]> wrote:

> Actually I think bug20175.phpt is a bad test at least the last part. The 
> functionality you are trying to test simply does not exist and has ever 
> existed. I've tested ZE1 and ZE2 and both return wow:2, I've asked people 
> using older PHPs to test this and it did not work on PHP 4.0.6 nor 4.0.4pl1.
> The documentation on functions and the changelog do not indicate that this 
> functionality is supported either.
> Therefor, I must conclude that the relevant bug is actually a feature request 
> and the last portion of test bug20175.phpt, which tries to use static inside 
> regular functions is bogus.
> Please remove the last portion of the test.
> 
> Ilia
> 
> On November 4, 2002 12:41 pm, Marcus Boerger wrote:
> > The static variable $wow_value stores a reference to a global variable.
> > Therefor the must not be a second call to wow_static() and hence the
> > value must not change.
> >
> > marcus
> >
> > At 18:25 04.11.2002, Ilia A. wrote:
> > >The 2nd wow should be '-wow:2' not 'wow:1'. For me it works in both ZE1
> > > and ZE2 for value of 2. The value of 2 is correct because the test
> > > increments the $wow_global variable twice. Please revert your change.
> > >
> > >Ilia
> > >
> > >On November 4, 2002 12:12 pm, Marcus B�rger wrote:
> > > > helly         Mon Nov  4 12:12:22 2002 EDT
> > > >
> > > >   Modified files:
> > > >     /php4/tests/lang  bug20175.phpt
> > > >   Log:
> > > >   2nd wow returns different results with ZE1/ZE2
> > > >
> > > >
> > > > Index: php4/tests/lang/bug20175.phpt
> > > > diff -u php4/tests/lang/bug20175.phpt:1.2
> > > > php4/tests/lang/bug20175.phpt:1.3 --- php4/tests/lang/bug20175.phpt:1.2
> > > > Mon Nov  4 11:46:28 2002 +++ php4/tests/lang/bug20175.phpt     Mon Nov 
> > > > 4 12:12:21 2002 @@ -48,7 +48,10 @@
> > > >
> > > >  /* Part 3:
> > > >   * Storing a reference to the result of a function in a static
> > > > variable. - * Same as Part 2 but wow_global() returns a reference.
> > > > + * Same as Part 2 but wow_global() returns a reference so $wow_value
> > > > + * should store a reference to $wow_global. Therefor $wow_value is
> > > > already + * initialised in second call to wow_static() and hence
> > > > shouldn't call + * wow_global() again.
> > > >   */
> > > >  $wow_global = 0;
> > > >  $wow_name = '';
> > > > @@ -82,4 +85,4 @@
> > > >  bar:1
> > > >  bar:2
> > > >  wow:1
> > > > -wow:2
> > > > +wow:1
> 
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to