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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to