You should read the php documentation for class and objects. It tells you that class member variables (called properties in the php doc) must be defined using private, protected or public (see visibility). Furthermore it tells you that they can only be declared using constant values, i.e. values that are defined at compile time, not run-time.
This means that you should add a visibility keyword, and that you cannot assign the value of a variable to a property.
Lastly, the documentation tells you to use $this-> to reference class members (properties, class methods, class constants).
class C
{
# wrong
$var = $otherVar;
# still wrong
private $var = $otherVar
# works
private $var = 2;
# also works
private $var;
# If you want to assign some variable value, do so in the constructor.
# This function is always run when you insantiate your class (create a new object)
public function __construct($var)
{
# $this->var references the property $var
# $var references the variable $var (function parameter)
$this->var = $var;
}
}
# instantiate an object of class C and assign 1 to C::$var
$c = new C(1)