cloning a php object
by Prakash[ Edit ] 2013-11-12 15:32:51
This way we can clone an object in php :
$object = new MyObject();
$object->setId(5);
$copy_of_object = clone $object;
print_r($object);
echo "<br />
print_r($object); // same result as object 1