I yesterday discovered strange issue in my class - hope you know some answers. Consider such a class:
class Person {
public $height = 90;
public $weight = $this->height * 0.8;
}
This class returns an error "Parse error: syntax error, unexpected T_VARIABLE" and it seems i can not declare variable in class that is variable itself. Can I only set "static" values to variables in class (i mean static like directly declared like string or int no static like "static $var = 'xyz'";Why is that happening?
Thanks, Kalreg.