if(!isset($users[$this->username])) $this->errorCode=self::ERROR_USERNAME_INVALID; else if($users[$this->username]!==$this->password) $this->errorCode=self::ERROR_PASSWORD_INVALID;
I appreciate that this is unlikely to be used as is for real world applications, but shouldn't this generate a more generic "incorrect username or password" error if either is invalid?

Help












