Hi,
I seems my suspiction is right as I didn't receive any reply from andrei.
So I post it to the list this time.
According to my deeper analysis. Unsetting an object will not touch any
thing related to the object execpt remove it from the active symbol. And
the same memory location(or handle) will be reallocated to the next new
object in some circumstances.
If so, aggregate.c will have a problem as it keeps an external
hash on the objects' handle and the aggregation information. Then when an
object is unset, there is no way to inform aggregate.c (or any other
extensions doing the similar thing) to remove the corresponding item from
it's hash. And the next new object will be regarded already aggregated.
So I guess it is not easy to fix the bug unless a patch is made to
Zend codes to deaggregate the object when unsetting (or maybe in some
other places, like assigning it with a same object).
Forgive me shallow understanding on Zend. I can only get that deeper
studying it no more than a day.
Wei He
On Tue, 17 Jun 2003, Wei He wrote:
> Hi,
>
> I have big suspicion on my mail system. Would you please confirm
> that you get this message? Thanks.
>
> Wei He
>
> P.S. The error of the following script is caught on PHP 4.3.2 +
> aggregation.c 1.11.4.5. The result, in case you don't have such
> an environment, is:
>
> Doing bar as foo ...
> Array
> (
> [bar] => Array
> (
> [methods] => Array
> (
> [0] => doit
> )
>
> [properties] => Array
> (
> )
>
> )
>
> )
> Doing bar as foo ...
>
> rather than expected as without the line unset($a):
>
> Doing bar as foo ...
> Doing bar as foobar ...
>
>
>
>
> On Mon, 16 Jun 2003, Wei He wrote:
>
> > Hi,
> >
> > I think the bug is not entirely fixed. Try the script below.
> >
> > Wei He
> >
> >
> > <pre>
> > <?php
> >
> > class bar {
> >
> > function doit()
> > {
> > print "Doing bar as " . get_class($this) . " ...\n";
> > }
> > }
> >
> > class foo {
> >
> > function foo()
> > {
> > print_r(aggregation_info($this));
> > aggregate($this, "bar");
> > }
> > }
> >
> > class foobar extends foo {
> > }
> >
> > $a = new foo();
> > $a->doit();
> >
> > unset($a);
> >
> > $b = new foobar();
> > $b->doit();
> >
> > ?>
> > </pre>
> >
> >
>
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php