I have a code similar to this:
$name = '_DBR'; // This comes from a function call
$this->_Inits['_DBR'] = function () { return get_library('Database')->getConnection('users', 'read'); };
$inits = $this->_Inits[$name];
$result = $inits(); // ERROR: Function name must be a string
return $result;
The error I get is:
Function name must be a string in xxxx
Is there any ways I could use an array to store multiple closures and is there a working way to access them?
I use PHP 5.4.3
Strict Standards: Only variables should be assigned by reference