Don’t clone your php objects, DeepCopy them
Link – – dcsg.me
Daniel Gomes, a developer at Teamleader, explains a potential problem when cloning object in PHP.
As you know, PHP has a well-known clone keyword that shallow copy all of the object’s properties. So under the hood what it does is to create a new Object with the exact same values of that object properties – unless you change its behavior by implementing the clone() function in your class.
Read more [dcsg.me]
What are your thoughts on "Don’t clone your php objects, DeepCopy them"?