Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4613526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:33:51+00:00 2026-05-22T01:33:51+00:00

I get two errors and I dont know how to fix this. I get

  • 0

I get two errors and I dont know how to fix this.

I get the error “syntax error, unfinished class declaration” at the line:

private $language;

I get “syntax error, unexpected ‘public’, expecting ‘EOF'” at the line:

public function getCurrencies()

This is the whole code:

class Driver extends Driver{

public static $url = "http://www.com/";
/* The method of posting data to the website */
public static $method = "GET";
/* The part of the url extending the domain name until the search term */
public static $url_searchbase = "search/searchresults.aspx?N=0&Ntt=";
/* The part of the url entailing the search term, deifining additional paramters */
public static $url_searchtail = "&Ntk=Primary&i=0&sw=n&ps=9999&pn=1";
private $currency;
private $language;
/* Allowed currencies */
$currencies = array("USD", "CAD");
/* Allowed languages */
$languages = array("ENU");

function __construct($currency, $language){
    if(setCurrency($currency) AND setLanguage($language)){
        return TRUE;
    } else {
        trigger_error("Currency '". $currency ."' or Language '". $language ."' not supported.", E_USER_ERROR);
        return FALSE;
    }
}

/*
 * Return an array of allowed currencies
 */
public function getCurrencies(){
    return $currencies;
}

/*
 * Set the currency
 */
function setCurrency($currency){
    if(in_array($currency, $this->$currencies)
    {
        $this->$currency = $currency;
        return TRUE;
    } else {
        trigger_error("Currency '". $currency ."' not supported.", E_USER_ERROR);
        return FALSE;
    }
}

/*
 * Return an array of allowed languages
 */
public function getLanguages(){
    return $languages;
}

/*
 * Set the language
 */
public function setLanguage($language){
        if(in_array($language, $this->$languages)
    {
        $this->$language = $language;
        return TRUE;
    } else {
        trigger_error("Language '". $language ."' not supported.", E_USER_ERROR);
        return FALSE;
    }
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:33:52+00:00Added an answer on May 22, 2026 at 1:33 am

    class Driver extends Driver makes no sense. I think you got one of the names wrong.

    Also, you cannot put real code outside of a function.

    Move

    /* Allowed currencies */
    $currencies = array("USD", "CAD");
    /* Allowed languages */
    $languages = array("ENU");
    

    into your __construct() function and use $this->var instead of $var.

    In if(in_array($currency, $this->$currencies) there’s missing a closing ).

    Same for if(in_array($language, $this->$languages)

    You are also accessing the member vars in an incorrect way. You need to use $this->var instead of $this->$var which would access the member variable whose name is stored in $var.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the following header I get the same two errors on all my sitemaps.
When merging two code branches in Team Foundation Server I get the following error:
I'm getting this linker error. I know a way around it, but it's bugging
Note: I'm kind of a noob so dont really know what these errors mean.
I get two strings formated like (Brazilian Format): DD/MM/YYYY, I need to compare both.
How do you get two unrelated controls to raise the same custom event? All
I must get two different client application talk without any kind of broker or
I need to get two JPanels into one JApplet. paneel = new RekenmachinePaneel(); nummer
I was just wondering if you can get two colours in a label so
What way it is to be to get two GET methods in the URL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.