Re: Inheritance problem

From: Date: Sun, 01 Dec 2002 12:12:11 +0000
Subject: Re: Inheritance problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126597@lists.php.net to get a copy of this message
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

« previous php.general (#126597) next »