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.
You should have a look at "magic methods". http://php.net/manual/en/language.oop5.overloading.php#object.call
maybe you can try this implementation (not tested):