I have a method which creates an instance of a child class and copies its properties over. I achieve this with $child->property = $this(parent)->propery
with each property. Is there a way to do this all in one bite without having to repeat the code to define each individual property?
Extended example:
class parent {
public $foo
$bar
$gib
public function foobar() {
$child = new child;
$child->foo = $this->foo;
$child->bar = $this->bar;
$child->gib = $this->gib;
}
}
class child extends parent {
}