My solution was similar to some method in actionscript (I'd guess addmember). You provide the variable's name and the names of the get/set functions.
PHP Code:
function someclass() {
temp.var = TStaticVar();
with (temp.var) {
this.rvalue = function (obj) {
return this.(@ obj);
};
this.lvalue = function (obj) {
return this.(@ obj).link();
};
this.addmember("counter","rvalue","lvalue");
this.counter = -1;
}
}
So depending on whether the member is the r- or lvalue, either function is called. It can be easily modified to allow for specific data types, variable protection, etc., and doesn't break backwards compatibility. The dummy/standard functions are given here.
Anyway, that's enough for derailing this thread, methinks.