Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHPEclipse Parser error


comks

Recommended Posts

I was wondering if anyone else gets this error in Eclipse using PHPEclipse. I am getting a parser error from sessions.php on line 33 which is this:

 

var $cookie_path = substr(DIR_WS_ADMIN, 0, -1);

 

and the error message is this:

 

Parser error "';' expected after field declaration."

 

TIA!

Link to comment
Share on other sites

  • 2 years later...

i know this is a very old post, but i got the same error, and i have no idea why :rolleyes:

 

i ask google about the error and this was the only result i received

 

	var $use_cookies = true;
var $cookie_lifetime = 0;
var $cookie_path = substr(DIR_WS_ADMIN, 0, -1);
var $cookie_domain = '';

Link to comment
Share on other sites

  • 11 months later...

Variable declarations in a class are required to be defined as constants if they are defined. This line attempts to calculate the value for $cookie_path, so it's technically wrong. However, I've never seen a server return an error for this. Check it on your site before you make changes.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Variable declarations in a class are required to be defined as constants if they are defined.

What you may need to do is to separate the variable declaration and its initialization.

var $cookie_path = '';

In the class initializer:

$cookie_path = substr(DIR_WS_ADMIN, 0, -1);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...