Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T_PAAMAYIM_NEKUDOTAYIM error calling static method

I have this error:

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in blog/wp-content/plugins/plugin/php/utils/cloud_data.php on line 98

static public function set_templates()
{
    static::fetch_templates(); // line 98
}

static private function fetch_templates($folder_identifier = '')
{
    // ..
}

Google says that T_PAAMAYIM_NEKUDOTAYIM means expecting. So error means: expecting T_VARIABLE.

But why? fetch_templates() function initializes his parameter to ''.

like image 994
Igor Parra Avatar asked Dec 04 '25 23:12

Igor Parra


1 Answers

static:: was introduced in 5.4 5.3, and likely you have older php

In your case you can replace it with

self::fetch_templates();
like image 166
zerkms Avatar answered Dec 07 '25 15:12

zerkms