When referring to $this->x in ABC the x variable has to be local to that class, in your example it is not. x is local to BCD since it is declared as private.
To fix this, change private $x=10; to public or protected (as mentioned above)
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.