Provides Deep Cloning (Copying) of objects and arrays
Copyright (c) 2018, Andreas Prucha (Abexto - Helicon Software Development) email@example.com
DeepClone is a package providing deep cloning (copying) of object instances in PHP.
Contrary to PHP's own clone functionality it does not rely on the class implementing it's cloning in the magic function
To install this library, run the command below and you will get the latest version
composer require amylian/deepclone --dev
DeepClone can be configured to handle special cases (e.g. instances of classes to be excluded from cloning in the instance tree), but in most cases this is not necessary. The straight forward use of DeepClone is:
$clonedObject = \Amylian\DeepClone\DeepClone::copy($originalObject);