Hallo Harry,
So ähnlich.
Du machst es Dir aber auch irgendwie unnötig kompliziert:
class event
{
var $funcs = array();
function reg($obj, $funcname)
$this->funcs[] = array (&$obj, $funcname);
function call () {
foreach ($this->funcs as $func) {
call_user_func ($func);
}
}
}
class test
{
function regme() {
$GLOBALS['eventobj']->reg(&$this, 'blabla');
}
function blabla() {
echo 'blabla';
}
}
$eventobj = new event();
$testobj = new test();
$testobj->regme();
$eventobj->call();
Viele Grüße,
Christian