Web lists-archives.com

re function name must be a string error




Hello;
In my last post I was struggling with the 
Fatal error: function name must be a string.
when a variable set to an anonymous function
is assigned to a static class member variable.

self::$staticVar = $funct // $funct contains anonymous function def
self::$staticVar(/* args */) // Fatal error: function name must be a string...

The fix I didn't remember, but I have now remembered was:
require(/* file with function def set to $_variable */);
self::$_staticVar = function(/* args */){return $_variable(/* args */)};

But the error may also occur when there is something wrong with the
args. That is what was hanging me up to begin with.

I hope someone can benefit from this experience.
JK