PHP·98 questions

How to clone an object?

Answer
$copy = clone $object.
__clone() for customization.
Shallow copy by default.
Deep — manually clone nested objects.
Difference with = (assignment by reference).
Was this answer helpful?

More questions in this topic

Related questions from other topics