Properly implementing cloning in aggregated classes : clone « Class « PHP






Properly implementing cloning in aggregated classes

 
class Person {
 public function __clone() { 
  $this->address = clone $this->address;
 }
}
  
  








Related examples in the same category

1.clone class instance
2.Change class instance after clone
3.clone a class
4.Cloning an aggregated class
5.Copying Objects
6.Parents clone