php - 致命错误:未捕获的错误:升级到 php 7.0 时,函数名称必须是...中的字符串
问题描述
我正在将我的网站 php ver 更新到 7.0 当我这样做时,它会在我们安装的主题上引发此错误,该主题不再受技术支持。这是它引用错误的代码。
/**
* Iterate over all template elements and if a rendering method for that element exists
* call that method. Pass the current element so the rendering class knows which values to use
*/
function generate_html()
{
foreach($this->template_elements as $element)
{
if(method_exists($this, $element['dynamic']))
{
if(isset($element['saved_value']))
{
$this->dynamic_counter ++;
$this->final_output[] = $this->$element['dynamic']({$element);
}
}
$this->current_index ++;
}
}
有没有人在 php 7.0 上有解决此错误的方法?