Question: I have an object that I'm passing in a method call. Say I'm using a language that only allows you to pass objects by reference, like Java or PHP. If the method makes changes to the object, it will affect the caller. I don't want this to happen. So it seems like I need to make a copy of the object.

My question is: whose responsibility is it to clone the object? The caller, before it calls the method? Or the callee, before it changes the object?

EDIT: Just to clarify, I want this to be part of the contract of this method -- that it never modifies the original object. So it seems like it should be up to the method to make the copy. But then the caller has no protection from a method that doesn't do this properly. I guess that's acceptable -- the only other alternative seems to be to have this built into the language.

Answer: 
Generally, the **caller should make the copy if it is concerned about changes**. If the caller doesn't care, **the method should make the copy if it needs to do something that it knows shouldn't persist**.
I would say the callee: it simplifies calls and caller won't have to worry for the integrity of the given objects. It is the responsibility of the callee to preserve the integrity.