note 73081 deleted from language.oop5.cloning by cmb
| From: | cmb@php.net | Date: | Mon, 03 Dec 2018 17:27:09 +0000 |
| Subject: | note 73081 deleted from language.oop5.cloning by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209848@lists.php.net to get a copy of this message | ||
Note Submitter: Alexey
----
To implement __clone() method in complex classes I use this simple function:
function clone_($some)
{
return (is_object($some)) ? clone $some : $some;
}
In this way I don't need to care about type of my class properties.