I wanted to initialize a class array as empty. For some reason, it's giving me the error "unexpected T_VARIABLE." Does anyone have an idea what's wrong with this class variable/array? This is what the class looks like:
class SentenceContentContainer {
var $strSentence; //theSentence entered
$arrayOfWords = []; //running the code has issue with this line
function SentenceContentContainer($strSentence)
{
$this->strSentence = $strSentence;
}
function addWordToContainer(&$wordToAdd)
{
...
}
} //SentenceContentContainer