T_PAAMAYIM_NEKUDOTAYIM调用静态方法时出错


T_PAAMAYIM_NEKUDOTAYIM error calling static method

我有这个错误:

分析错误:语法错误,意外的T_PAAMAYIM_NEKUDOTAYIM,第98行上的blog/wp-content/plugins/plugin/php/utils/cloud_data.php中应为T_VARIABLE

static public function set_templates()
{
    static::fetch_templates(); // line 98
}
static private function fetch_templates($folder_identifier = '')
{
    // ..
}

谷歌表示,T_PAAMAYIM_NEKUDOTAYIM意味着期望。所以错误意味着:应为T_VARIABLE。

但为什么呢?fetch_templates()函数将他的参数初始化为''

static::是在5.45.3中引入的,您可能有较旧的php

在您的情况下,您可以将其替换为

self::fetch_templates();