What is meant when the results of __clone() is a "Shallow Clone"?
This means that when the object is cloned, any properties that are reference variables (variables that refer to other objects, rather than a value) will remain references.
A "non-shallow" clone would set the new object's to the values of those properties, rather than leaving them as references.
Note: This means that any changes you make to those references in the cloned object will also be made to the values they reference in the "parent" object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With