# I caught the aggregation bug!

- Thread: https://externals.io/message/2038
- Original archive: https://news-web.php.net/php.internals/2038
- Started by Wei He on 2003-05-27T13:13:08+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #2038 — Wei He — 2003-05-27T13:13:08+00:00

URL: https://externals.io/message/2038#2038

Hi,

My mail system have encountered some problem so I'm afraid the following
message was not posted successfully.  

Here it is again. Please forgive me if it is duplicated.

Wei He

---------- Forwarded message ----------
Date: Fri, 23 May 2003 23:44:52 +0800 (CST)
Subject: I caught the aggregation bug!

Hi,

This short script can reproduce the aggregation bug I reported above.

class bar {
 
   function doit()
   {
      print " Doing...\n";
   }
}

class foo {

   function foo()
   {
       print_r(aggregation_info($this));
       aggregate($this, "bar");
   }
   
   function spawn()
   {
       return new foo();
   }
}

$a = new foo();
$a->doit();
$b = $a->spawn();
$b->doit();
unset($a);
$c = $b->spawn();
$c->doit();

Besides 'unset($a)', '$a = new foo()' will also cause the same problem.

Wei He
