静的クラスのプロパティを定義するときに、値を割り当てようとしています。
namespace Base;
abstract class Skeleton {
protected static $entityManager = \Zend_Registry::get("EntityManager");
...
}
このコードを実行しようとすると、次のエラーが発生します。
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /var/www/
somewhere/application/models/Base/Skeleton.php on line 6
単純な文字列値を割り当てるだけの場合:
protected static $entityManager = "string";
すべてが大丈夫です。PHPが処理できないことをしていますか?もしそうなら、これを解決する方法は?