Possible Duplicate:
Caller function in PHP 5?
Ben bir başka uzanan bazı nesneler var, ve çeşitli yardımcı yöntemler çağırır. Başka denilen hangi yöntemi algılamak için bir yol olup olmadığını merak ediyorum. İşte bir örnek:
class Foo {
function whereAmICalled() {
$calling_method = '' //would like to get func_caller here when code is executed
$calling_class = '' //would like to get 'Bar' here when code is executed
}
}
class Bar extends Foo {
function func_caller() {
$this->whereAmIcalled();
}
}
$bar = New Bar();
$bar->func_caller();