ID:               23038
 Updated by:       [EMAIL PROTECTED]
 Reported By:      black at sunshine dot krneki dot org
-Status:           Bogus
+Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: linux debian
 PHP Version:      4.3.2-RC
 Assigned To:      andrei


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

[2003-06-23 17:35:43] black at sunshine dot krneki dot org

Got Result:

Doing bar as foo ...
Array
(
    [bar] => Array
        (
            [methods] => Array
                (
                    [0] => doit
                )

            [properties] => Array
                (
                )

        )

)
Doing bar as foo ...

i know the get_class() returns wrong classname on second hit, as it
returns 'foo' instead of 'foobar'.

Expected result should be:

Doing bar as foo ...
Doing bar as foobar ...

Clear enough for you, sniper, buddy? (sorry about this taunt)

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

[2003-06-23 17:25:27] [EMAIL PROTECTED]

Not enough info (as in: what was the expected result, etc..etc..)


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

[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.



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

[2003-05-23 11:14:44] hewei at ied dot org dot cn

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.

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

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