class base{
public $c = 'c';
public $sub = '';
function __construct(){
$this->sub = new sub();
}
}
class sub extends base{
public $ab = 'abs';
function __construct(){
$this->c = 'aas';
echo 'Test';
}
}
$a = new base();
print_r($a);
I would like to the sub class to edit the base vars $this->c = 'blabla';
how can i achieve this?
Why not just override it:
Otherwise, if you need to modify the actual base property, use
parentas Wrikken suggested.