ID:               36167
 User updated by:  mail at ejika dot net
 Reported By:      mail at ejika dot net
 Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Windows 2000, Free BSD
 PHP Version:      5.1.2
 New Comment:

Php don't clean memory using by object after __destruction of object
request.


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

[2006-01-26 16:48:08] [EMAIL PROTECTED]

See bug #33348

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

[2006-01-26 16:27:09] mail at ejika dot net

Description:
------------
Wrong count of the references to object.
And wrong define object lifetime.

Reproduce code:
---------------
class A   
{   
    function __construct()  
    { 
        echo 'A::__construct()<br>'; 
    }  
       
    function foo()   
    {   
        echo 'foo();<br>';   
    }   
       
    function __destruct()   
    {   
        echo 'A::__destruct()<br>';   
    }   
}   

    
    
class Test   
{   
    private $a;

    function __construct( & $a )   
    {   
        $this->a = $a;
        echo 'Test::__construct()<br>'; 
    }   

    function __destruct()   
    {   
        $this->a->foo();
        echo 'Test::__destruct()<br>';   
    }   
}   

$a = new A();   
$t = new Test( $a );

Expected result:
----------------
A::__construct()
Test::__construct()
foo();
A::__destruct()
Test::__destruct()

Actual result:
--------------
A::__construct()
Test::__construct()
A::__destruct()
foo();
Test::__destruct()


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


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

Reply via email to