note 79546 deleted from language.oop5.cloning by danbrown
| From: | danbrown@php.net | Date: | Thu, 11 Dec 2008 19:51:04 +0000 |
| Subject: | note 79546 deleted from language.oop5.cloning by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148046@lists.php.net to get a copy of this message | ||
Note Submitter: david ashe at metabin
----
Here is a function to clone all of the objects automatically
(useful if you use a base class that has this method)
function __clone(){
foreach($this as $name => $value){
if(gettype($value)=='object'){
$this->$name= clone($this->$name);
}
}
}