What I wanted to do is to set static $variable to 'new value'. This is my code:
class myobj {
static protected $variable = null;
static function test() {
static::variable = 'new value'
}
}
$obj = new myobj();
$obj->test();
But an error shows up:
Parse error: syntax error, unexpected '=' in D:\!TC\www\error.php on line 8
Use:
instead of:
BTW I strongly encourage you to use an IDE able to directly tell you basic syntax errors, like Aptana Studio or PHPStorm.