RE: [PHP] Inheritance-problem

From: Date: Wed, 09 Aug 2000 17:10:32 +0000
Subject: RE: [PHP] Inheritance-problem
Groups: php.general 
Request: Send a blank email to php-general+get-10961@lists.php.net to get a copy of this message
I just tried the exact code below, and the output was: Class B visitedClass A visited So it looks like you're in luck if you upgrade to PHP4. --Bruce Bruce Christensen Intel Corporation brucex.r.christensen@intel.com -----Original Message----- From: Martin [mailto:martin@thomatechnik.de] Sent: Wednesday, August 09, 2000 4:59 AM To: php-general@lists.php.net; Brian Clark Subject: Re: [PHP] Inheritance-problem No, nothing of your choices ;-) class A { function DoSomething() { print "Class A visited"; } } class B extends A { function DoSomething() { print "Class B visited"; A::DoSomething(); ## Doesn't work, only for example } } I want to make (in PHP3): $b = new B(); $b->DoSomething(); The output shout be: Class B visited Class A visited (This is only a stupid example, I know ;-)) Regards Martin -- 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 (#10961) next »