$this->property = 'SomeClass';
$x = new $this->property(); // works
$x = $this->property::create(); // fails (parse error)
これはPHPのバグですか?
新しい変数に値を割り当てずに、プロパティを使用して静的メソッドを呼び出すことができますか?代わりにその変数を使用しますか?
$this->property = 'SomeClass';
$x = new $this->property(); // works
$x = $this->property::create(); // fails (parse error)
これはPHPのバグですか?
新しい変数に値を割り当てずに、プロパティを使用して静的メソッドを呼び出すことができますか?代わりにその変数を使用しますか?
使用するcall_user_func
$x = call_user_func(array($this->property, 'create'));