clone

clones a object with to with its own new memory space

Syntax

object.clone()

Returns

returns a (object) memory copy

Parameters

None

Usage

my_object.test = 1;

my_new_object = my_object.clone();
my_new_object.test = 0;

echo(my_object.test); // returns 1
echo(my_new_object.test); // returns 0