Hi,
thanks for your answers.
I want to find that out, so that I can check if the class is owned by a specific object, so that I can use its variables and functions as well. That saves me from declaring the same functions and members twice. I don't want want to inherit the class, for it makes no sense in my context:
class calendar {
var $now = getdate();
function calendar () {
for (...) {
$d = new day();
...
}
}
}
class day{
function day() {
...
echo $owner->now;
}
}
It just makes no logical sense to inherit a calendar from a day. Maybe the best thing is really to pass the reference into the constructor of day.
It is possible in other programming languages (such as Delphi) to get the owner and so climb up the hierarchy. I thought maybe there is a php function that does the same :bemused:
Lynky