時意外T_VARIABLE我收到以下錯誤解析錯誤:語法錯誤,在路徑 /queries.php意外T_VARIABLE上,因爲陣列$_queryArray
線92PHP:初始化關聯數組
:
private $_queryA = "";
etc...
private $_queryV = "";
private $_queryArray = array( 'A' => $this->_queryA, //<= line 92 of my code
'B' => $this->_queryB,
'C' => $this->_queryC,
'D' => $this->_queryD,
'E' => $this->_queryE,
'F' => $this->_queryF,
'G' => $this->_queryG,
'H' => $this->_queryH,
'I' => $this->_queryI,
'J' => $this->_queryJ,
'K' => $this->_queryK,
'L' => $this->_queryL,
'M' => $this->_queryM,
'N' => $this->_queryN,
'O' => $this->_queryO,
'P' => $this->_queryP,
'Q' => $this->_queryQ,
'R' => $this->_queryR,
'S' => $this->_queryS,
'T' => $this->_queryT,
'U' => $this->_queryU,
'V' => $this->_queryV
);
我的填充方式有問題嗎$_queryArray ?
謝謝!
使它成爲一個空數組,並在構造函數中填充它,當你構建查詢時 –
更好,然後改爲getter函數。 –