我試圖定義它,當一個值賦給一個靜態類屬性:Zend和靜態類屬性
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不能處理的事情嗎?如果是這樣,如何解決這個問題?