Using $this in method called with call_user_func_array
array("Foo", "bar")
is equal to Foo::bar()
, i.e. a static method - this makes sense since $foo
is nowhere used and thus PHP cannot know which instance to use.
What you want is array($foo, "bar")
to call the instance method.
See http://php.net/manual/en/language.types.callable.php for a list of the various callables.
You also need to pass the arguments as an indexed array instead of an associative array, i.e. array(1)
instead of array('id' => 1)