amylian/deepclone

Provides Deep Cloning (Copying) of objects and arrays

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

This package is auto-updated.

Last update: 2024-12-13 14:00:29 UTC


README

Copyright (c) 2018, Andreas Prucha (Abexto - Helicon Software Development) andreas.prucha@gmail.com

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

Installation

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

Links

Amylian/DeepClone Wiki on GitHub