Tag Info

Hot answers tagged


If I'm writing code on the client side, I don't know which of the variables I pass to a function might be changed and which I can expect to remain the same without an explicit knowledge of the parent function declaration. This is as it should be. When you call an API, you should know what you are calling and why. You should also know what the function ...


No, they are not the same bars, since you are calling new. Also I don't see $bars being used anywhere in wireFoosAndBars. Use the exact "associated" instances from $bars when constructing the new collection and they will be the same objects. You are correct in that clone is the only way to make a copy of an object. Modifying an object's properties, no ...

Only top voted, non community-wiki answers of a minimum length are eligible