Hi,
I have a strange problem, but I really need to figure out how this works.
abstract class A
{
function A() { echo "constr. A"; }
static abstract function foo();
}
class B extends A
{
function B() { echo "constr. B"; }
static function foo() { echo "B::foo"; }
}
class C extends A
{
function C() { echo "constr. C"; }
static function foo() { echo "C::foo"; }
}
function getClName()
{
return C;
}
$clname = getClName();
// $obj = new $clname(); // this would work
$clname::foo(); // this does not work! how can I make this work?
I think you can see my problem. I want to call a static method of a class I don't know. It works perfectly when constructing an object and calling its non-static methods. But how can I call its static methods without creating an object from it?
greetings, Salim