I have 2 classes that one of them extends another:
class a{
private $name;
public function __construct(){
}
public function get($v){
$this->name=$v;
}
}
class b extends a{
public $user;
}
at top of page I'm creating an object:
$a=new a();
$a->get(1234);
and then I'm creating another object from class b.
$b=new b();
but I want to copy all current variables of $a to $b. so class $b would have variable $name with value 1234.
how can I do this?