note 58240 deleted from language.oop5.cloning by aidan
| From: | aidan@php.net | Date: | Fri, 09 Dec 2005 04:03:38 +0000 |
| Subject: | note 58240 deleted from language.oop5.cloning by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-99791@lists.php.net to get a copy of this message | ||
Note Submitter: office at 4point-webdesign dot de
----
if you want to do "deep cloning" you may use this function:
<?
public function __clone() {
foreach($this as $k=>$i) {
$this->{$k}=clone $i;
}
}
?>
it might not work for evry hierachical object-structure but maybe it gives you an idea how to solve
deep cloning :>