overwritting parent static variables
Posted: Sun Nov 09, 2008 8:11 pm
I was wondering if I can do something like
I am a complete php newb and would greatly appreciate any help. For the purposes of the program I am writing I can also make $value a constant as long as they are class values and not instance values.
Code: Select all
class A{
function hello(){
prints(self::$value);
}
}
class B extends A{
static $value = "something";
}
class C extends A{
static $value = "something else";
}
B::hello(); //want this to print "something";
C::hello(); //want this to print "something else";