I have an array (class property) which stores PHP methods (i.e., of class 'Closure'). Just like this.
$this->methods[$name]=$action;
$action
is the function.
When I try invoking the function like $this->methods[$name]()
, I'm unable to access $this
pointer inside function.
Why is this issue happening and how do I fix it.