[web] [php] static vars?

Started by
1 comment, last by tstrimp 18 years ago
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?
Advertisement
Try
class Engine{    public static $basePath = 'hello?';}


or maybe

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

Also, make sure you're using a version of PHP that supports static. 5.0+ I think.

This topic is closed to new replies.

Advertisement