Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Which one of the following is the right way to clone an object?

a) clone(targetObject);
b) destinationObject = clone targetObject;
c) destinationObject = _clone(targetObject);
d) destinationObject = clone(targetObject);

Answer: b
Explanation: 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;

Join The Discussion