ID:               46126
 Updated by:       [EMAIL PROTECTED]
 Reported By:      lorenzo dot reffo at gmail dot com
-Status:           Open
+Status:           Feedback
-Bug Type:         Class/Object related
+Bug Type:         Scripting Engine problem
 Operating System: Linux Ubuntu
 PHP Version:      5.2.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi




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

[2008-09-19 15:37:44] lorenzo dot reffo at gmail dot com

Description:
------------
I encountered an error while assigning multiple class to an object into
another class.

Suppose to have a class A in which is defined a property. At the begin,
I use the property as an instance of another class B, then I do an
'unset' of property before creating assigning it an instance of class C.

Reproduce code:
---------------
class B {
    # do something
}

class C {
    # do something
}

class A {
    private $_prop;

    function __construct() {
        $this->_prop = new B();
    }

    function Re () {
        unset($this->_prop);
        $this->_prop = new C();
    }
}

$h = new A()
$h->Re();
unset($h);

Expected result:
----------------
I expect it to work correctly (I read a post before where staff said it
has been fixed in version 5.2.x).

Actual result:
--------------
it crashes when calling 'Re' method giving me an error:

Allowed memory size of ... bytes exhausted etc.


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


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

Reply via email to