class Base {
protected $vars;
public function set($params){
$this -> vars = $params;
}
}
class Child extends Base{
public function get(){
echo $this -> vars;
}
}
$base = new Base;
$base -> set('test');
$child = new Child;
$child -> get();
$class = new Child;
$class->set('test');
echo $class->get();