Reputation: 3875
I got an error Function name must be a string
on this line, I think it's might be a compatibility problem because this line was written in php 7
public static $renderers = array();
public static function somefunction($tpl, $params)
{
return self::$renderers[$tpl]($params);
}
Upvotes: 3
Views: 462
Reputation: 15633
You need to assign the closure to a variable first before you can execute it,
$foo = self::$renderers[$tpl];
$foo($params);
Upvotes: 1