Less than 1 minute
deep_clone
Performs a deep clone on an object or array.
public deep_clone({Array})
The standard PHP clone function will only perform a shallow copy of the object. PHP has implemented the __clone() magic method to allow objects to recursively clone properties. However, this does not help when you are cloning a \stdClass object. This function allows you to perform a deep clone of any object, including \stdClass and also clone all it's properties recursively.
Parameters
Parameter | Type | Description |
---|---|---|
$object | mixed | The object to clone. If the parameter is an array then it will be recursed. If it is anything it simply returned as is. |
Generated by Hazaar API Doc Generator