Hi,
Sunday, December 1, 2002, 10:05:53 PM, you wrote:
BC> Hi,
BC> I would like to post the following question related to an inheritance
BC> problem with PHP OO programming :
BC> With an object of a subclass, I call a method of the parentclass in order
BC> to modify an attribute of the parentclass. It does work correctly but later
BC> when I call the display method of the parentclass, I receive the previous
BC> value of the attribute !!!
Try this:
class Rain
{
var $jungle;
function Rain(&$jungle) //<<<<<
{
$this->jungle =& $jungle; //<<<<<
}
function fall($density)
{
$this->jungle->receiverain($density);
}
} // Rain
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php