php copy object code example
Example 1: php empty object
$x = new stdClass();
Example 2: php clone
//Copies an existing object
$objectA = clone $objectB;
Example 3: php clone object
$objectB = clone $objectA;
$x = new stdClass();
//Copies an existing object
$objectA = clone $objectB;
$objectB = clone $objectA;