Provides Deep Cloning (Copying) of objects and arrays

v0.1.0 2019-05-13 01:10 UTC

This package is auto-updated.

Last update: 2023-05-13 10:34:05 UTC


Copyright (c) 2018, Andreas Prucha (Abexto - Helicon Software Development)


Version Travis Result
V 0.1.0 V 0.1.0 Status
Master Master Status

Function Summary

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__clone().


To install this library, run the command below and you will get the latest version

composer require amylian/deepclone --dev

Basic Usage

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);


Amylian/DeepClone Wiki on GitHub