ID:               23038
 Updated by:       [EMAIL PROTECTED]
 Reported By:      black at sunshine dot krneki dot org
-Status:           Verified
+Status:           Wont fix
 Bug Type:         Scripting Engine problem
 Operating System: linux debian
 PHP Version:      4.3.3RC2-dev
 New Comment:

aggregate does not exist in PHP 5. And as we're focusing on PHP 5
development, this is now 'wont fix' for PHP 4.



Previous Comments:
------------------------------------------------------------------------

[2003-09-03 05:32:28] hewei at ied dot org dot cn

Although the ChangeLog says that this bug has been fixed,
my above script still doesn't work as expected.

------------------------------------------------------------------------

[2003-08-05 21:57:45] hewei at ied dot org dot cn

The following message is what I send to PHP's developer list on Jun 18.
It was never confirmed by anyone for whether my analysis was correct or
not. 

My conclusion could be very possibily wrong as my understanding to
PHP/Zend sources was still very shallow.
I just hope it may provide useful information for anyone on further
studying of this bug.

I still hope Andrei or someone else that knows something can confirm
this. I spent quite sometime trying to find out if I can do something
on this bug as my contribution of PHP.
----------------------------------------------------------

According to my deeper analysis. Unsetting an object will not touch any
thing related to the object execpt remove it from the active symbol
table. 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 their 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 happened to use the same memory
location will still be regarded as the original one by aggregate.c.
That's why the above script will print a wong class name. Also because
the old object was aggregated, the aggregate.c will refuse to perform
aggregation on it.

So I guess it is not easy to fix the bug unless a patch is made to Zend
codes to add a hook for aggregate.c to deaggregate an object when
unsetting (or maybe in some other places, like assigning it with a same
object).

------------------------------------------------------------------------

[2003-07-27 14:30:21] [EMAIL PROTECTED]

This problem has little to do with aggregation functions. This is a ZE
scripting language problem. This can be demonstrated by adding
var_dump(get_class($this)) inside the foo constructor. It'll always
print "foo", the name of the class for the class the constructor is
for, not the 'real' class.

------------------------------------------------------------------------

[2003-06-21 09:17:30] hewei at ied dot org dot cn

The bug is not fixed. Run the following script either before or after
applying andrei's recent patch, one will reproduct the bug.
<?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();

?>

------------------------------------------------------------------------

[2003-06-04 14:02:58] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/23038

-- 
Edit this bug report at http://bugs.php.net/?id=23038&edit=1

Reply via email to