Feature request: clone() function
| From: | Christian Schneider | Date: | Sun, 16 Nov 2003 11:43:41 +0000 |
| Subject: | Feature request: clone() function | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-5492@lists.php.net to get a copy of this message | ||
I'd like to see a clone() (or whatever name you want) function which should exist in both PHP4 and PHP5 and allows to clone objects in a compatible way.
Currently I'm using
function &clone(&$object)
{
return (is_object($object) && version_compare(zend_version(), '2.0.0-dev', '<')) ? $object : $object->__clone();} but I think this should be provided by PHP itself to easy migration. As always I'd be willing to provide an implementation if wanted ;-) - Chris