changed object after storage or object-state used
问题 Example: class UserStorage { public function addUser(User $user) { //saves to db } } class User { public function setName($name); } What if I add a user to the user storage and later change that user object? In this case you might argue that user objects only should be stored on __destruct. But sometimes this isn't an option (eg imagine the user is displayed and updated afterwards). 回答1: I agree with Peter, the above model seems a little quirky to me and I would recommend against implicit