"I would like to create a browser-based text RPG, using PHP and MySQL as the backend. It must have these features [describe them]"
That depends on where you're using it. If you're using a browser version, chances are you'll be copy/pasting. If you're using a plugin with your editor (Junie for JetBrains, for example, or a Claude API extension in VSCode), then you can instruct it - after granting permissions - to add/edit/delete files at will
Yes. Migration shims have existed for years. No public-facing AI is generative (even if it claims to be) as they're fed source material and "create" from that. Everything is regurgitated without context. So, with that in mind, the existence of a shim being publicly available (Git), and the simple ability to read, an AI could update PHP5 to PHP8 practices. Be sure to specify which version of PHP8. For example; 8.3 introduces a number of breaking changes to code that would otherwise be fine in PHP8.2 (current latest is 8.5.8 and I loooooooove the deprecations - can do so much more with so much less now!
Let it be known that I bloody well hate AI and the ego a number of self-entitled "developers" (vibe coders) seem to pack with it. Studies by MIT have shown that those who depend on AI incur up to a 47% drop in connectivity and engagement, combined with a 32-ish% decrease in critical thinking and short-term memory recollection.
I'm not stopping you from using it, nor am I trying to dissuade you. It is a tool like any other and, like any other, it can be misused.
All I can advise, strongly, is that you don't let robots think for you