Below is an example of what I'm trying to do. The parent can't access any of the child's variables. It doesn't matter what technique I use (static or constants), I just need some kind of functionality like this.
class ParentClass
{
public static function staticFunc()
{
//both of these will throw a (static|const) not defined error
echo self::$myStatic;
echo self::MY_CONSTANT;
}
}
class ChildClass extends ParentClass
{
const MY_CONSTANT = 1;
public static $myStatic = 2;
}
ChildClass::staticFunc();
I know this sucks, but I am not using 5.3. Any hacky solution that involves eval is more than welcome.