我有一个语法错误,意外的'::'

An amazing thing:

Class Myclass{

 protected $_value = 'content';

 public function action(){

  $this->_value::mymethod();
 }

}

=> I've got an error:

syntax error, unexpected '::'

If I modify like this, it works:

$myvalue = $this->_value;
$myvalue::mymethod();

Do you know why??

PHP cannot confidently determine what you are trying to accomplish with

$this->_value::mymethod();

It can be read as either

{$this->_value}::mymethod() (what you expect it to be)

or

$this->{_value::mymethod()}.

So instead of guessing and might be wrong, it generates an error. Just use the way around it that you already discovered.