You know how in Java you have Math.Pi, which is a public static final double value that is always available everywhere?
Well in PHP I have a superclass that will have to have a static array, $errorArray. And I want to be able to always set it from any class anywhere, anytime, and retrieve it from any class, anywhere, anytime.
Bluntly put, how do I do it? I tried this and it does not produce the results I want (namely, no results at all after testing):
class SuperClass {
function SuperClass() {
static $errorArray = array();
}
}
class SubClass extends SuperClass {
function SubClass() {}
function doStuff() {
print_r(SuperClass::errorArray);
}
}
Phil