$rv = deepCopy($sourceRef, $targetRef);
This function performs a deep and safe copy of arbitrary data structures,
checking for circular references along the way. Hashes and lists are safely
duplicated while all other data types are just copied. This means that any
embedded object references, etc., are identical in both the source and the
target, which is probably not what you want.
In short, this should only be used on pure hash/list/scalar value data
structures. Both the source and the target reference must be of an identical
This function returns the number of elements copied unless it runs into a
problem (such as a circular reference), in which case it returns a zero.