Re: OOP

From: Date: Sun, 24 Jun 2001 04:38:46 +0000
Subject: Re: OOP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55012@lists.php.net to get a copy of this message
It sure is, but your code needs to look like this: class one { function one() { echo "one "; } } class two extends one { function two() { parent::one(); echo "two "; } } class three extends two { function three() { parent::two(); echo "three"; } } $foo = new three(); ----------------------------------------------- Matty. ----- Original Message ----- From: "Andrew Kirilenko" <icedwork@flashmail.com> To: "PHP General" <php-general@lists.php.net> Sent: Sunday, June 24, 2001 6:04 AM Subject: [PHP] OOP > Hello! > > Is it possible to do normal inheritance on PHP? > I've following code: > > ---> > > class one > { > function one() > { > echo "one "; > } > } > > class two extends one > { > function two() > { > echo "two "; > } > } > > class three extends two > { > function three() > { > echo "three"; > } > } > > $foo = new three(); > > <--- > > And the output of this programm is "three", but not "one two three" :( > > Best regards, > Andrew Kirilenko, > Seniour Programmer / System Administrator, > Internet Service. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#55012) next »