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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -