Which one of the following is the right way to clone an object?
A
_clone(targetObject);
B
destinationObject = clone targetObject;
C
destinationObject = _clone(targetObject);
Correct Answer: destinationObject = clone targetObject;
You can clone an object by prefacing it with the clone keyword. A copy of an object is created by using the clone keyword. $copy_of_object = clone $object;