inheritance-problem

From: Date: Mon, 21 Aug 2000 11:01:03 +0000
Subject: inheritance-problem
Groups: php.general 
Request: Send a blank email to php-general+get-12748@lists.php.net to get a copy of this message
Hi ! Imagin the following class structure: class A { var $MyVar = 1; function Output() { print $this->MyVar; } function MyFunc() { Output(); } } class B extends A { var $MyVar = 2; function AnotherFunc() { Output(); } } The output will be "2", if called "AnotherFunc" in an instance of class B But in class A I want to get access to A::MyVar (as it would be in C) -> "1". How is it done ? Regards Martin

« previous php.general (#12748) next »