php - Stop new object from updating with old object's variables -
i'm trying like:
$obj2 = $obj1 where $var1 object, problem want $obj2 snap shot of $obj1 - how @ moment, $obj1's variables change, $obj2's change well. possible? or going have create new "dummy" class can create clone?
simply clone object, so:
$obj2 = clone $obj1; any modifications members of $obj1 after above statement not reflected in $obj2.
Comments
Post a Comment