Sign in to follow this  
supagu

[web] [php] static vars?

Recommended Posts

i want to put a staticc var in my class, yet it complains that its not expected?!
class Engine
{
	static $basePath = 'hello?';



the error i get is:
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' 

any ideas why this could be?

Share this post


Link to post
Share on other sites
Try

class Engine
{
public static $basePath = 'hello?';
}



or maybe


class Engine
{
public static $basePath;
}
Engine::$basePath = 'hello?';


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this