clone $object
Description
A copy of an object is created, as a shallow copy. A shallow copy, means that new references and objects will not be created, when the object is cloned. So, the cloned object and its clone will still interact with the same objects.
Usage: $clonedObject = clone $object; $dateTime = new DateTime(); echo (clone $dateTime)->format('Y');