I am trying to implement singleton pattern for a class. I have a static variable $classInstance and when assigning class object getting the error "Parse error: syntax error, unexpected '='".
/**
* Hold instance of class.
*/
private static $classInstance = null;
/**
* Create the client connection.
*/
public static function createClient() {
if (self::classInstance === null) {
self::classInstance = new self(); // Getting error on this line.
}
return self::classInstance;
}