I know this is a very generic error, but I am getting a:
( ! ) Parse error: syntax error, unexpected 'openFile' (T_STRING), expecting variable (T_VARIABLE) in //file on line 13
and here is my relavent code:
class Dictionary{
private $fileHandler;
const FILESRC = 'resources/dictionary.txt';
//Just in case I want to extend class to write dictionary;
const FILEMODE = 'r';
const MAXLINES = 1024;
protected openFile(){
if(!isset($this->$fileHandler))
$this->$fileHandler = fopen(self::FILESRC, self::FILEMODE);
}
}
I can't seem to find solutions, tryed some of the simular problems, but the error is too generic I also had a look over at PHP Parse/Syntax Errors; and How to solve them?
Any suggestions would be of much needed help.
Thanks in advance