Re: cvs: php4 /tests/lang bug20175.phpt
| From: | Ilia A. | Date: | Mon, 04 Nov 2002 18:30:45 +0000 |
| Subject: | Re: cvs: php4 /tests/lang bug20175.phpt | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-15789@lists.php.net to get a copy of this message | ||
On November 4, 2002 01:22 pm, Marcus Boerger wrote:
> What about:
> http://www.php.net/manual/en/language.references.return.php
I see no mention of static here, do you? The documentaion also talks about
returning an object, not a regular variable as your example does.
The bug #20175 says and I quote:
"we've recently put in a set of methods in the binarycloud
core classes so they can enforce their singleton status.".
This implies (to me) that the function used is actually within a class, I did
a small test using classes and in both ZE1 and ZE2 it has worked properly in
both cases.
Ilia
>
> At 19:19 04.11.2002, Ilia A. 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