我有这个错误:
解析错误:语法错误,意外的 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 = '')
{
// ..
}
Google 说 T_PAAMAYIM_NEKUDOTAYIM 表示期待。所以错误意味着:期待 T_VARIABLE。
但是为什么? fetch_templates()
函数将他的参数初始化为 ''
。
最佳答案
static::
是在 5.4 5.3 中引入的,可能您使用的是较旧的 php
在您的情况下,您可以将其替换为
self::fetch_templates();
关于php - T_PAAMAYIM_NEKUDOTAYIM 错误调用静态方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12310620/