The [[https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSave|PageContentSave]] hook takes a number of parameters which are references (the content to save, the author, the flags etc), so there is a natural expectation that these can be changed by the hook handler. In reality though, all but the status are discarded.summary, flags and status can be replaced, but new values assigned to the user or the content are discarded. (Replacing the WikiPage, as far as I can tell, never did anything, and I can't imagine a sane use case for doing so.)
This did work untilwas broken in MediaWiki 1.31 (except for the WikiPage;2 during the #multi-content-revisions rewrite by e8632ab0f6264851d2115a2e6338c2074b9a9b8c. as far as I can tellI can't remember if this was intentional or not, changing that never did anything and I can't imagine a sane use case for doing so)and even if it was accidental we might want to leave it that way (seems like it could violate a lot of assumptions, and was broken by e8632ab0f6264851d2115a2e6338c2074b9a9b8c. I can't remember if this was intentional or not,e.g. and even if it was accidental we might want to leave it that waycaching based on the user), but at a minimum it should be documented and a replacement suggested.